using ARNetToC;
using System;
using System.Collections;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Data;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
namespace BMC.ARSystem
{
	[ClassInterface, Guid("1f8af06a-9b6c-42ab-9d8c-eea95c7f8fbc"), ProgId("BMC.ARSystem.Server")]
	public class Server : IOperationTime
	{
		[Guid("ab062339-5ec2-43eb-bc3c-accf5cf39e14")]
		public enum FieldDeleteOption
		{
			cleanDelete,
			dataDelete,
			forceDelete
		}
		[Guid("b3f7e878-d944-426e-850b-3c599fc9d017")]
		public enum SetEntryByQuery_NoMatchOption
		{
			Error = 1,
			NoAction = 3,
			SubmitEntry
		}
		[Guid("6519d106-380f-422e-b855-3fce70f8fbec")]
		public enum SetEntryByQuery_MultiMatchOption
		{
			Error = 1,
			ModifyFirst = 3,
			PickList,
			ModifyAll,
			NoAction
		}
		[Guid("9d1bca5f-fdf0-4f7c-b487-5348be11f118")]
		public class SetEntryByQuery_PickEntryFromListArgs
		{
			public ArrayList MatchingEntries;
			public string SelectedEntyForPush;
			internal SetEntryByQuery_PickEntryFromListArgs(ArrayList matchingEntries)
			{
				this.MatchingEntries = ArrayList.ReadOnly(matchingEntries);
				this.SelectedEntyForPush = null;
			}
		}
		[Guid("b057af2f-d47f-4720-afc7-76ed1f62a25a")]
		public delegate void SetEntryByQuery_PickEntryFromListEventHandler(Server.SetEntryByQuery_PickEntryFromListArgs e);
		[Guid("766c3c4a-a65b-44be-bfe0-f164e90b63ad")]
		public enum MergeDuplicateOption
		{
			Error = 1,
			CreateNewRecord,
			OverwriteExisting,
			UpdateExisting
		}
		[Guid("b56cf73f-690d-41f5-b278-83fb64c03ccb")]
		public class ARXImportBeginArgs
		{
			public string FileName;
			public long DataSize;
			public string FormName;
		}
		[Guid("c32f8809-2f3d-419d-a015-ceb483ab6e49")]
		public class ARXImportRecordBeginArgs
		{
			public readonly uint RecordNumber;
			public readonly long BytesProcessed;
			public FieldValueList FieldValues;
			public Server.MergeDuplicateOption MergeDuplicateOption;
			public bool SkipRecord;
			public bool StopImport;
			internal ARXImportRecordBeginArgs(uint recordNum, long bytesProcessed, FieldValueList fieldValueList, Server.MergeDuplicateOption mergeDuplicateOption)
			{
				this.RecordNumber = recordNum;
				this.BytesProcessed = bytesProcessed;
				this.FieldValues = fieldValueList;
				this.MergeDuplicateOption = mergeDuplicateOption;
				this.SkipRecord = (this.StopImport = false);
			}
		}
		[Guid("deb28d66-c5a5-4759-88ef-39429a6f2187")]
		public class ARXImportLoadAttachmentValueEventArgs
		{
			private uint m_recordNumber;
			private long m_fieldId;
			private string m_fileName;
			private Stream m_loadFrom;
			public uint RecordNumber
			{
				get
				{
					return this.m_recordNumber;
				}
			}
			public long FieldId
			{
				get
				{
					return this.m_fieldId;
				}
			}
			public string FileName
			{
				get
				{
					return this.m_fileName;
				}
			}
			public Stream LoadValueFrom
			{
				get
				{
					return this.m_loadFrom;
				}
				set
				{
					this.m_loadFrom = value;
				}
			}
			internal ARXImportLoadAttachmentValueEventArgs(uint recordNumber, uint fieldId, string fileName)
			{
				this.m_recordNumber = recordNumber;
				this.m_fieldId = (long)((ulong)fieldId);
				this.m_fileName = fileName;
				this.m_loadFrom = null;
			}
		}
		[Guid("787fd529-c6da-4c68-81c2-7b3ab02f30bc")]
		public class ARXImportRecordEndArgs
		{
			public readonly uint RecordNumber;
			public readonly long BytesProcessed;
			public readonly FieldValueList FieldValues;
			public readonly string EntryId;
			public bool StopImport;
			internal ARXImportRecordEndArgs(uint recordNum, long bytesProcessed, FieldValueList fieldValueList, string entryId)
			{
				this.RecordNumber = recordNum;
				this.BytesProcessed = bytesProcessed;
				this.FieldValues = fieldValueList;
				this.EntryId = entryId;
				this.StopImport = false;
			}
		}
		[Guid("a56ffa65-1dfd-4108-8a63-9a2e76af6309")]
		public class ARXImportRecordFailedArgs
		{
			public uint RecordNumber;
			public Exception FailureReason;
			public FieldValueList FieldValues;
		}
		[Guid("9761bcc0-6846-405a-96da-8772d793b2fa")]
		public class ARXImportEndArgs
		{
			public readonly string FileName;
			public readonly long BytesProcessed;
			public readonly uint NumRowsImported;
			public readonly uint NumNewRowsCreated;
			public readonly uint NumRowsFailed;
			public readonly uint NumRowsSkipped;
			internal ARXImportEndArgs(string fileName, long bytesProcessed, uint numRowsImported, uint numNewRowsCreated, uint numRowsFailed, uint numRowsSkipped)
			{
				this.FileName = fileName;
				this.BytesProcessed = bytesProcessed;
				this.NumRowsImported = numRowsImported;
				this.NumNewRowsCreated = numNewRowsCreated;
				this.NumRowsFailed = numRowsFailed;
				this.NumRowsSkipped = numRowsSkipped;
			}
		}
		[Guid("cbbf1fcb-86a4-461d-a390-cbab84e4c182")]
		public delegate void ARXImportBeginEventHandler(Server.ARXImportBeginArgs e);
		[Guid("5d0fd5ea-833c-4cee-8e8a-6d3319ba12a4")]
		public delegate void ARXImportRecordBeginEventHandler(Server.ARXImportRecordBeginArgs e);
		[Guid("5d1c71bb-c8d3-477d-bb99-278e89a3cfc9")]
		public delegate void ARXImportLoadAttachmentValueEventHandler(Server.ARXImportLoadAttachmentValueEventArgs e);
		[Guid("d695b081-4570-49cb-81a5-7b4e59f650ff")]
		public delegate void ARXImportRecordEndEventHandler(Server.ARXImportRecordEndArgs e);
		[Guid("b6e2a112-072b-4b97-b332-22888eaffad9")]
		public delegate void ARXImportRecordFailedEventHandler(Server.ARXImportRecordFailedArgs e);
		[Guid("734279bc-410c-4d2c-be4d-ea50cfbf65c4")]
		public delegate void ARXImportEndEventHandler(Server.ARXImportEndArgs e);
		[Guid("41afaf23-9070-459e-870f-2213bbdd3db8")]
		public enum DataExportFormat
		{
			ARX,
			CSV,
			XML
		}
		[Guid("db02250f-3f3c-4ba9-8e75-aab9eaa5973c")]
		public enum ExecuteProcessActionType
		{
			Unknown,
			SetFields = 2,
			RunProcess
		}
		private enum SpecialCommandIds
		{
			ARAPP_APPLIC_2_QUAL = 2,
			ARAPP_APPLIC_2_QUAL_FILTER,
			ARAPP_APPLIC_2_QUAL_SFIELDS,
			ARAPP_APPLIC_2_NAME_TO_ID = 6,
			ARAPP_APPLIC_2_ID_TO_NAME,
			ARAPP_APPLIC_2_VAL_SFIELDS,
			ARAPP_APPLIC_2_FMT_QUAL,
			ARAPP_APPLIC_2_FMT_QUAL_FLTR,
			ARAPP_APPLIC_2_FMT_QUAL_SFLD,
			ARAPP_APPLIC_2_FMT_VAL_SFLD,
			ARAPP_APPLIC_2_QUAL_L = 20,
			ARAPP_APPLIC_2_FMT_QUAL_L,
			ARAPP_APPLIC_2_NAME_TO_ID_L,
			ARAPP_APPLIC_2_ID_TO_NAME_L,
			ARAPP_APPLIC_2_FMT_QUAL_ID,
			ARAPP_APPLIC_2_GET_FORM_ALIAS = 28,
			ARAPP_APPLIC_2_GET_FORM_NAME,
			ARAPP_APPLIC_2_GET_LOCALE_VUIID = 36,
			ARAPP_APPLIC_2_QUAL_SFIELDS_L
		}
		[Guid("84464a8e-ddd2-40d3-b1e3-d48166c5aef8")]
		public enum ImportConflictHandlingOptions
		{
			Error = 16,
			Overwrite = 32,
			NoAction = 48
		}
		[Guid("cb135d50-456a-4742-86ea-2d41addb4ae4")]
		public enum ImportOptions
		{
			Create,
			Overwrite,
			DeleteExtraFields = 64,
			EntryDuplicateReject = 128,
			EntryDuplicateNewId = 256,
			EntryOverwrite = 512,
			EntryMerge = 1024,
			EntryAllNewId = 2048,
			DeleteExtraVui = 4096,
			PermissionOverwrite = 8192,
			WorkflowPreserve = 16384,
			WorkflowAttachListMerge = 32768,
			HistoryPreserve = 65536,
			IndexPreserve = 131072,
			VuiNamespacePreserve = 262144,
			AppFormsPreserve = 524288,
			AppAuthor = 1048576,
			AttachListPreserve = 2097152,
			AttachListRemove = 4194304
		}
		[Guid("0974a133-0990-4863-860a-e1b79faa578c")]
		public enum UserListType
		{
			Myself,
			Registered,
			Current
		}
		[Guid("e673751f-b400-4634-b71e-e3d91484c0c0")]
		public enum LogType
		{
			SqlLog = 1,
			FilterLog,
			ApiLog = 16,
			PluginLog = 131072
		}
		[Guid("8649a10e-bdec-456d-bbd8-4ba2f39c3025")]
		public enum ObjectType
		{
			Form = 1,
			ARForm = 1,
			ActiveLink = 6,
			Filter = 5,
			Escalation = 9,
			Menu = 8,
			Container = 12,
			Field = 15,
			Image = 17,
			Application = 16,
			VUI = 14
		}
		[Guid("a04550ce-c218-40a6-92b0-74529a6a8294")]
		public enum GroupType
		{
			None,
			View,
			Change
		}
		[Guid("5e233896-1b41-4d24-af3d-00f4d0a9de00")]
		public enum GroupCategory
		{
			Regular,
			Dynamic,
			Computed
		}
		[Guid("408F22EC-618B-46b0-BD05-5A8E17A10D74")]
		public enum CacheEvent
		{
			adminOnlyCreate = 1,
			adminOnlyPublic,
			cacheFree
		}
		private const int ADMINRPC = 390600;
		private const int DEFAULTRPC = 0;
		private int _returnCode;
		private object _control;
		private ArrayList _statusList;
		private ArrayList _lastBulkEntryTransactionReturnList;
		private bool _isAdministrator;
		private bool _isSubAdministrator;
		private bool _isMemberOfCustomizeGroup;
		private int _tcpPort;
		private int _rpcProgramNum;
		private string _logFilePath;
		private uint _logFilePtr;
		private string _serverName;
		private string _userName;
		private string _password;
		private string _authString;
		private string _locale;
		private string _charSet;
		private ServerInformation _serverInfo;
		private Session _session;
		private bool _isInAROnlyContext = true;
		public event Server.SetEntryByQuery_PickEntryFromListEventHandler SetEntryByQuery_PickEntryFromListEvent
		{
			[MethodImpl(32)]
			add
			{
				this.SetEntryByQuery_PickEntryFromListEvent = (Server.SetEntryByQuery_PickEntryFromListEventHandler)Delegate.Combine(this.SetEntryByQuery_PickEntryFromListEvent, value);
			}
			[MethodImpl(32)]
			remove
			{
				this.SetEntryByQuery_PickEntryFromListEvent = (Server.SetEntryByQuery_PickEntryFromListEventHandler)Delegate.Remove(this.SetEntryByQuery_PickEntryFromListEvent, value);
			}
		}
		public event Server.ARXImportBeginEventHandler ARXImportBeginEvent
		{
			[MethodImpl(32)]
			add
			{
				this.ARXImportBeginEvent = (Server.ARXImportBeginEventHandler)Delegate.Combine(this.ARXImportBeginEvent, value);
			}
			[MethodImpl(32)]
			remove
			{
				this.ARXImportBeginEvent = (Server.ARXImportBeginEventHandler)Delegate.Remove(this.ARXImportBeginEvent, value);
			}
		}
		public event Server.ARXImportRecordBeginEventHandler ARXImportRecordBeginEvent
		{
			[MethodImpl(32)]
			add
			{
				this.ARXImportRecordBeginEvent = (Server.ARXImportRecordBeginEventHandler)Delegate.Combine(this.ARXImportRecordBeginEvent, value);
			}
			[MethodImpl(32)]
			remove
			{
				this.ARXImportRecordBeginEvent = (Server.ARXImportRecordBeginEventHandler)Delegate.Remove(this.ARXImportRecordBeginEvent, value);
			}
		}
		public event Server.ARXImportLoadAttachmentValueEventHandler ARXImportLoadAttachmentValueEvent
		{
			[MethodImpl(32)]
			add
			{
				this.ARXImportLoadAttachmentValueEvent = (Server.ARXImportLoadAttachmentValueEventHandler)Delegate.Combine(this.ARXImportLoadAttachmentValueEvent, value);
			}
			[MethodImpl(32)]
			remove
			{
				this.ARXImportLoadAttachmentValueEvent = (Server.ARXImportLoadAttachmentValueEventHandler)Delegate.Remove(this.ARXImportLoadAttachmentValueEvent, value);
			}
		}
		public event Server.ARXImportRecordEndEventHandler ARXImportRecordEndEvent
		{
			[MethodImpl(32)]
			add
			{
				this.ARXImportRecordEndEvent = (Server.ARXImportRecordEndEventHandler)Delegate.Combine(this.ARXImportRecordEndEvent, value);
			}
			[MethodImpl(32)]
			remove
			{
				this.ARXImportRecordEndEvent = (Server.ARXImportRecordEndEventHandler)Delegate.Remove(this.ARXImportRecordEndEvent, value);
			}
		}
		public event Server.ARXImportRecordFailedEventHandler ARXImportRecordFailedEvent
		{
			[MethodImpl(32)]
			add
			{
				this.ARXImportRecordFailedEvent = (Server.ARXImportRecordFailedEventHandler)Delegate.Combine(this.ARXImportRecordFailedEvent, value);
			}
			[MethodImpl(32)]
			remove
			{
				this.ARXImportRecordFailedEvent = (Server.ARXImportRecordFailedEventHandler)Delegate.Remove(this.ARXImportRecordFailedEvent, value);
			}
		}
		public event Server.ARXImportEndEventHandler ARXImportEndEvent
		{
			[MethodImpl(32)]
			add
			{
				this.ARXImportEndEvent = (Server.ARXImportEndEventHandler)Delegate.Combine(this.ARXImportEndEvent, value);
			}
			[MethodImpl(32)]
			remove
			{
				this.ARXImportEndEvent = (Server.ARXImportEndEventHandler)Delegate.Remove(this.ARXImportEndEvent, value);
			}
		}
		public object _Context
		{
			get
			{
				return this._control;
			}
		}
		public object _ARControlStruct
		{
			get
			{
				return ARTypeMgr.Instance.ObjectFromVariant(typeof(ARControlStruct), this._control, this);
			}
		}
		public string ClientCharSet
		{
			get
			{
				return this.GetCharSet(false);
			}
		}
		public string ServerCharSet
		{
			get
			{
				return this.GetCharSet(true);
			}
		}
		public int LastReturnCode
		{
			get
			{
				return this._returnCode;
			}
		}
		public ArrayList LastStatus
		{
			get
			{
				return this._statusList;
			}
		}
		public DateTime LastOperationTime
		{
			get
			{
				object[] v = new object[]
				{
					"_LastOperationTime",
					this._control
				};
				object[] array = (object[])this._Eval(v);
				double num = Convert.ToDouble(array[0]);
				return new DateTime(1970, 1, 1).AddSeconds(num);
			}
		}
		public bool IsAdministrator
		{
			get
			{
				return this._isAdministrator;
			}
		}
		public bool IsSubAdministrator
		{
			get
			{
				return this._isSubAdministrator;
			}
		}
		public bool IsMemberOfCustomizeGroup
		{
			get
			{
				return this._isMemberOfCustomizeGroup;
			}
		}
		public string User
		{
			get
			{
				return this._userName;
			}
		}
		public string ServerName
		{
			get
			{
				return this._serverName;
			}
		}
		public string AuthenticationString
		{
			get
			{
				return this._authString;
			}
		}
		public int ServerPort
		{
			get
			{
				return this._tcpPort;
			}
		}
		public bool IsLoggedInAsUTF8
		{
			get
			{
				return this._charSet != null && 0 == string.Compare("UTF-8", this._charSet, true);
			}
		}
		public string Version
		{
			get
			{
				if (this._serverInfo == null)
				{
					return "7.1 0";
				}
				return this._serverInfo.GetstringValue(4);
			}
		}
		public int VersionMajor
		{
			get
			{
				string[] array = this.Version.Split(new char[]
				{
					'.'
				});
				if (array.Length <= 0)
				{
					return 7;
				}
				return Convert.ToInt32(array[0]);
			}
		}
		public int VersionMinor
		{
			get
			{
				string[] array = this.Version.Split(new char[]
				{
					'.'
				});
				if (array.Length <= 1)
				{
					return 0;
				}
				return Convert.ToInt32(array[1]);
			}
		}
		public string VersionPatch
		{
			get
			{
				string[] array = this.Version.Split(new char[]
				{
					'.'
				});
				if (array.Length <= 2)
				{
					return "";
				}
				return array[2];
			}
		}
		[EditorBrowsable]
		uint IOperationTime.ThirdOperationTime
		{
			get
			{
				object[] v = new object[]
				{
					"_ThirdOperationTime",
					this._control
				};
				object[] array = (object[])this._Eval(v);
				return Convert.ToUInt32(array[0]);
			}
			set
			{
				object[] v = new object[]
				{
					"_FourthOperationTime",
					this._control,
					value
				};
				object[] arg_2F_0 = (object[])this._Eval(v);
			}
		}
		internal string Password
		{
			get
			{
				return this._password;
			}
		}
		internal Session Session
		{
			get
			{
				if (this._session == null)
				{
					this._session = Session.DefaultSession;
					this._session.AddServer(this);
				}
				return this._session;
			}
			set
			{
				this._session = value;
			}
		}
		public Server()
		{
			this._tcpPort = 0;
			this._logFilePtr = 0u;
			this._isAdministrator = (this._isSubAdministrator = (this._isMemberOfCustomizeGroup = false));
			this._returnCode = 0;
		}
		public void Login(string server, string user, string password)
		{
			this.Login(server, user, password, "");
		}
		public void Login(string server, string user, string password, string authentication)
		{
			this.Login(server, user, password, authentication, this._tcpPort);
		}
		public void Login(string server, string user, string password, string authentication, int port)
		{
			this.Login(server, user, password, authentication, null, null, port);
		}
		public void Login(string server, string user, string password, string authentication, string locale, string charSet)
		{
			this.Login(server, user, password, authentication, locale, charSet, 0);
		}
		public void Login(string server, string user, string password, string authentication, string locale, string charSet, int port)
		{
			this._performLogin("ARInitialization", server, user, password, authentication, locale, charSet, port, null, null, false);
		}
		public void Login(string server, string user, string password, string authentication, string locale, string charSet, int port, string apiCmdLog, string apiResLog, bool logInitAndTerm)
		{
			this._performLogin("ARInitializationWithLogs", server, user, password, authentication, locale, charSet, port, apiCmdLog, apiResLog, logInitAndTerm);
		}
		public void _performLogin(string methodName, string server, string user, string password, string authentication, string locale, string charSet, int port, string apiCmdLog, string apiResLog, bool logInitAndTerm)
		{
			ARControlStruct aRControlStruct = new ARControlStruct();
			aRControlStruct.Server = server;
			this._serverName = server;
			aRControlStruct.User = user;
			this._userName = user;
			aRControlStruct.Password = password;
			this._password = password;
			aRControlStruct.AuthString = authentication;
			this._authString = authentication;
			aRControlStruct.LocaleInfo.Locale = locale;
			this._locale = locale;
			aRControlStruct.LocaleInfo.CharSet = charSet;
			this._charSet = charSet;
			object obj = ARTypeMgr.Instance.toVariant(aRControlStruct);
			object[] v = new object[]
			{
				methodName,
				obj,
				apiCmdLog,
				apiResLog,
				logInitAndTerm
			};
			object[] arg_C4_0 = (object[])this._Eval(v);
			try
			{
				if (port != 0)
				{
					this.SetServerPort(port, 0);
				}
				if (methodName.Equals("ARInitialization"))
				{
					this._isInAROnlyContext = true;
					this.VerifyUser(out this._isAdministrator, out this._isSubAdministrator, out this._isMemberOfCustomizeGroup);
					this._serverInfo = ServerInformation.CreateInstance(this);
				}
				else
				{
					this._isInAROnlyContext = false;
				}
			}
			catch (Exception var_3_115)
			{
			}
		}
		public void Logout()
		{
			this._performLogout("ARTermination");
		}
		public void _performLogout(string methodName)
		{
			if (this._control == null || Convert.ToInt32(this._control) == 0)
			{
				return;
			}
			try
			{
				this.DisableServerLoggingToClient();
				object[] v = new object[]
				{
					methodName,
					this._control
				};
				object[] arg_3E_0 = (object[])this._Eval(v);
			}
			catch (Exception)
			{
			}
			if (this._session != null)
			{
				this._session.RemoveServer(this);
				this._session = null;
			}
		}
		[ComVisible(false)]
		public void VerifyUser(out bool isAdmin, out bool isSubAdmin, out bool isCustomize)
		{
			isAdmin = (isSubAdmin = (isCustomize = false));
			if (!this._isInAROnlyContext)
			{
				return;
			}
			object[] v = new object[]
			{
				"ARVerifyUser",
				this._control
			};
			object[] array = (object[])this._Eval(v);
			this._isAdministrator = (isAdmin = (bool)array[3]);
			this._isSubAdministrator = (isSubAdmin = (bool)array[4]);
			this._isMemberOfCustomizeGroup = (isCustomize = (bool)array[5]);
		}
		public void SetServerPort(int port, int rpcProgramNum)
		{
			this._tcpPort = port;
			this._rpcProgramNum = rpcProgramNum;
			if (this._control != null)
			{
				object[] v = new object[]
				{
					"ARSetServerPort",
					this._control,
					this.ServerName,
					this._tcpPort,
					rpcProgramNum
				};
				object[] arg_5C_0 = (object[])this._Eval(v);
				try
				{
					this.VerifyUser(out this._isAdministrator, out this._isSubAdministrator, out this._isMemberOfCustomizeGroup);
					this._serverInfo = ServerInformation.CreateInstance(this);
				}
				catch (Exception var_1_83)
				{
				}
			}
		}
		public void LockToAdminPort()
		{
			this.SetServerPort(this.ServerPort, 390600);
		}
		public void UseDefaultPort()
		{
			this.SetServerPort(this.ServerPort, 0);
		}
		public void CreateForm(ARForm form)
		{
			this.Session.CurrentObjectType = Server.ObjectType.Form;
			this.Session.CurrentLocalForm = form.Name;
			object name = form.Name;
			object[] array = new object[2];
			if (form is RegularForm)
			{
				array[0] = 1;
			}
			else
			{
				if (form is JoinForm)
				{
					array[0] = 2;
					JoinForm joinForm = form as JoinForm;
					array[1] = new object[]
					{
						joinForm.MemberA,
						joinForm.MemberB,
						joinForm.Qualification,
						joinForm.Option
					};
				}
				else
				{
					if (form is ViewForm)
					{
						array[0] = 3;
						ViewForm viewForm = form as ViewForm;
						array[1] = new object[]
						{
							viewForm.TableName,
							viewForm.KeyField
						};
					}
					else
					{
						if (form is DisplayOnlyForm)
						{
							array[0] = 4;
						}
						else
						{
							if (form is VendorForm)
							{
								array[0] = 5;
								VendorForm vendorForm = form as VendorForm;
								array[1] = new object[]
								{
									vendorForm.VendorName,
									vendorForm.TableName
								};
							}
							else
							{
								array[0] = 1;
							}
						}
					}
				}
			}
			object obj = null;
			object obj2 = ARTypeMgr.Instance.toVariant(form.Permissions);
			object obj3 = ARTypeMgr.Instance.toVariant(form.AdminGroups);
			object obj4 = ARTypeMgr.Instance.toVariant(form.ResultListFields);
			object obj5 = null;
			object obj6 = null;
			object obj7 = null;
			object obj8 = null;
			object defaultVui = form.DefaultVui;
			object helpText = form.HelpText;
			object owner = form.Owner;
			object obj9 = (form.ChangeDiary != null) ? form.ChangeDiary.AppendedText : null;
			ARTypeMgr arg_1D5_0 = ARTypeMgr.Instance;
			string arg_1D5_1 = "BMC.ARSystem.FieldValueList";
			string arg_1D5_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj10 = arg_1D5_0.BuildVariantFromCustomDictionary(arg_1D5_1, arg_1D5_2, keyIndex, "ARValue", new int[]
			{
				1
			}, form.Properties);
			object modificationLogLabel = form.ModificationLogLabel;
			object[] v = new object[]
			{
				"ARCreateSchema",
				this._control,
				name,
				array,
				obj,
				obj2,
				obj3,
				obj4,
				obj5,
				obj6,
				obj7,
				obj8,
				defaultVui,
				helpText,
				owner,
				obj9,
				obj10,
				modificationLogLabel
			};
			int rpcProgramNum = this._rpcProgramNum;
			this.LockToAdminPort();
			object[] arg_286_0 = (object[])this._Eval(v);
			if (form.ArchiveInformation != null || form.AuditInformation != null)
			{
				form.MembersModified = new BitVector32(1537);
				this.SetForm(form);
			}
			this.SetServerPort(this._tcpPort, rpcProgramNum);
		}
		public void DeleteForm(string name)
		{
			this.DeleteForm(name, 11);
		}
		public void DeleteForm(string name, int deleteOption)
		{
			this.DeleteForm(name, deleteOption, null);
		}
		public void DeleteForm(string name, int deleteOption, string modificationLogLabel)
		{
			this.DeleteObject("ARDeleteSchema", name, deleteOption, modificationLogLabel);
		}
		public ARForm GetForm(string name)
		{
			this.Session.CurrentObjectType = Server.ObjectType.Form;
			this.Session.CurrentLocalForm = name;
			object[] v = new object[]
			{
				"ARGetSchema",
				this._control,
				name
			};
			object[] rawData = (object[])this._Eval(v);
			return ARForm.createInstance(rawData, this);
		}
		public ArrayList GetListForm()
		{
			return this.GetListForm(new DateTime(1970, 1, 1));
		}
		public ArrayList GetListForm(DateTime changedSince)
		{
			object obj = Util.GetARTimestamp(changedSince);
			object[] array = new object[7];
			array[0] = "ARGetListSchema";
			array[1] = this._control;
			array[2] = obj;
			array[3] = 1024;
			array[4] = "";
			object[] arg_50_0 = array;
			int arg_50_1 = 5;
			object[] array2 = new object[0];
			arg_50_0[arg_50_1] = array2;
			object[] arg_5E_0 = array;
			int arg_5E_1 = 6;
			array2 = new object[0];
			arg_5E_0[arg_5E_1] = array2;
			object[] v = array;
			object[] array3 = (object[])this._Eval(v);
			return new ArrayList((object[])array3[8]);
		}
		public ArrayList GetListForm(uint[] fieldIdList)
		{
			object obj = Util.GetARTimestamp(new DateTime(1970, 1, 1));
			object obj2 = ARTypeMgr.Instance.toVariant(fieldIdList);
			object[] array = new object[8];
			array[0] = "ARGetListSchema";
			array[1] = this._control;
			array[2] = obj;
			array[3] = 1024;
			array[4] = "";
			array[5] = obj2;
			object[] arg_6C_0 = array;
			int arg_6C_1 = 6;
			object[] array2 = new object[0];
			arg_6C_0[arg_6C_1] = array2;
			object[] arg_7A_0 = array;
			int arg_7A_1 = 7;
			array2 = new object[0];
			arg_7A_0[arg_7A_1] = array2;
			object[] v = array;
			object[] array3 = (object[])this._Eval(v);
			return new ArrayList((object[])array3[8]);
		}
		public void SetForm(ARForm form)
		{
			this.Session.CurrentObjectType = Server.ObjectType.Form;
			this.Session.CurrentLocalForm = form.Name;
			int data = form.MembersModified.get_Data();
			object name = form.Name;
			object newName = form.NewName;
			object[] array = new object[2];
			if (form is RegularForm)
			{
				array[0] = 1;
			}
			else
			{
				if (form is JoinForm)
				{
					array[0] = 2;
					JoinForm joinForm = form as JoinForm;
					array[1] = new object[]
					{
						joinForm.MemberA,
						joinForm.MemberB,
						joinForm.Qualification,
						joinForm.Option
					};
				}
				else
				{
					if (form is ViewForm)
					{
						array[0] = 3;
						ViewForm viewForm = form as ViewForm;
						array[1] = new object[]
						{
							viewForm.TableName,
							viewForm.KeyField
						};
					}
					else
					{
						if (form is DisplayOnlyForm)
						{
							array[0] = 4;
						}
						else
						{
							if (form is VendorForm)
							{
								array[0] = 5;
								VendorForm vendorForm = form as VendorForm;
								array[1] = new object[]
								{
									vendorForm.VendorName,
									vendorForm.TableName
								};
							}
							else
							{
								array[0] = 1;
							}
						}
					}
				}
			}
			object obj = null;
			object obj2 = ARTypeMgr.Instance.toVariant(form.Permissions);
			object obj3 = ARTypeMgr.Instance.toVariant(form.AdminGroups);
			object obj4 = ARTypeMgr.Instance.toVariant(form.ResultListFields);
			object obj5 = ARTypeMgr.Instance.toVariant(form.SortList);
			object obj6 = ARTypeMgr.Instance.toVariant(form.IndexList);
			object obj7 = ARTypeMgr.Instance.toVariant(form.ArchiveInformation, this);
			object obj8 = ARTypeMgr.Instance.toVariant(form.AuditInformation, this);
			object defaultVui = form.DefaultVui;
			object helpText = form.HelpText;
			object owner = form.Owner;
			object obj9 = (form.ChangeDiary != null) ? form.ChangeDiary.AppendedText : null;
			ARTypeMgr arg_232_0 = ARTypeMgr.Instance;
			string arg_232_1 = "BMC.ARSystem.FieldValueList";
			string arg_232_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj10 = arg_232_0.BuildVariantFromCustomDictionary(arg_232_1, arg_232_2, keyIndex, "ARValue", new int[]
			{
				1
			}, form.Properties);
			object obj11 = 0;
			object modificationLogLabel = form.ModificationLogLabel;
			object[] v = new object[]
			{
				"ARSetSchema",
				this._control,
				data,
				name,
				newName,
				array,
				obj,
				obj2,
				obj3,
				obj4,
				obj5,
				obj6,
				obj7,
				obj8,
				defaultVui,
				helpText,
				owner,
				obj9,
				obj10,
				obj11,
				modificationLogLabel
			};
			object[] arg_2F5_0 = (object[])this._Eval(v);
		}
		public void CreateContainer(Container container)
		{
			object name = container.Name;
			object obj = ARTypeMgr.Instance.toVariant(container.Permissions);
			object obj2 = ARTypeMgr.Instance.toVariant(container.AdminGroups);
			object obj3 = ARTypeMgr.Instance.toVariant(container.ContainerOwners);
			object label = container.Label;
			object description = container.Description;
			object obj4;
			if (container is ActiveLinkGuide)
			{
				obj4 = 1;
			}
			else
			{
				if (container is ApplicationContainer)
				{
					obj4 = 2;
					((ApplicationContainer)container).SaveRefs(this);
				}
				else
				{
					if (container is PackingList)
					{
						obj4 = 3;
						((PackingList)container).SaveRefs(this);
					}
					else
					{
						if (container is FilterGuide)
						{
							obj4 = 4;
						}
						else
						{
							if (container is WebServiceContainer)
							{
								obj4 = 5;
								((WebServiceContainer)container).SaveRefs(this);
							}
							else
							{
								obj4 = 3;
							}
						}
					}
				}
			}
			object obj5 = ARTypeMgr.Instance.toVariant(container.References);
			bool flag = false;
			object helpText = container.HelpText;
			object owner = container.Owner;
			object obj6 = (container.ChangeDiary != null) ? container.ChangeDiary.AppendedText : null;
			ARTypeMgr arg_140_0 = ARTypeMgr.Instance;
			string arg_140_1 = "BMC.ARSystem.FieldValueList";
			string arg_140_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj7 = arg_140_0.BuildVariantFromCustomDictionary(arg_140_1, arg_140_2, keyIndex, "ARValue", new int[]
			{
				1
			}, container.Properties);
			object[] v = new object[]
			{
				"ARCreateContainer",
				this._control,
				name,
				obj,
				obj2,
				obj3,
				label,
				description,
				obj4,
				obj5,
				flag,
				helpText,
				owner,
				obj6,
				obj7,
				container.ModificationLogLabel
			};
			object[] arg_1D4_0 = (object[])this._Eval(v);
		}
		public void DeleteContainer(string name)
		{
			this.DeleteContainer(name, 0);
		}
		public void DeleteContainer(string name, int deleteOption)
		{
			this.DeleteContainer(name, deleteOption, null);
		}
		public void DeleteContainer(string name, int deleteOption, string modificationLogLabel)
		{
			this.DeleteObject("ARDeleteContainer", name, deleteOption, modificationLogLabel);
		}
		public Container GetContainer(string name)
		{
			object[] v = new object[]
			{
				"ARGetContainer",
				this._control,
				name,
				new object[]
				{
					1
				}
			};
			object[] rawData = (object[])this._Eval(v);
			return Container.createInstance(rawData, this);
		}
		public ArrayList GetListContainer()
		{
			return this.GetListContainer(0);
		}
		public ArrayList GetListContainer(int containerTypesMask)
		{
			return this.GetListContainer(containerTypesMask, null);
		}
		public ArrayList GetListContainer(int containerTypesMask, string formName)
		{
			return this.GetListContainer(containerTypesMask, formName, new DateTime(1970, 1, 1));
		}
		public ArrayList GetListContainer(int containerTypesMask, DateTime changedSince)
		{
			return this.GetListContainer(containerTypesMask, null, changedSince);
		}
		public ArrayList GetListContainer(int containerTypesMask, string formName, DateTime changedSince)
		{
			object obj = Util.GetARTimestamp(changedSince);
			object[] v = new object[]
			{
				"ARGetListContainer",
				this._control,
				obj,
				new object[]
				{
					containerTypesMask
				},
				1,
				(formName != null && formName.get_Length() > 0) ? new object[]
				{
					new object[]
					{
						2,
						formName
					}
				} : null
			};
			object[] array = (object[])this._Eval(v);
			return Util.BuildGLCOResponse((object[])array[8]);
		}
		public ArrayList GetListActiveLinkGuide()
		{
			return this.GetListContainer(1);
		}
		public ArrayList GetListActiveLinkGuide(string formName)
		{
			return this.GetListActiveLinkGuide(formName, new DateTime(1970, 1, 1));
		}
		public ArrayList GetListActiveLinkGuide(string formName, DateTime changedSince)
		{
			return this.GetListContainer(1, formName, changedSince);
		}
		public ArrayList GetListApplication()
		{
			return this.GetListApplicationContainer();
		}
		public ArrayList GetListApplicationContainer()
		{
			return this.GetListContainer(2);
		}
		public ArrayList GetListFilterGuide()
		{
			return this.GetListContainer(4);
		}
		public ArrayList GetListFilterGuide(string formName)
		{
			return this.GetListFilterGuide(formName, new DateTime(1970, 1, 1));
		}
		public ArrayList GetListFilterGuide(string formName, DateTime changedSince)
		{
			return this.GetListContainer(4, formName, changedSince);
		}
		public ArrayList GetListPackingList()
		{
			return this.GetListContainer(3);
		}
		public ArrayList GetListWebService()
		{
			return this.GetListContainer(5);
		}
		public ArrayList GetListWebService(string formName)
		{
			return this.GetListWebService(formName, new DateTime(1970, 1, 1));
		}
		public ArrayList GetListWebService(string formName, DateTime changedSince)
		{
			return this.GetListContainer(5, formName, changedSince);
		}
		public void SetContainer(Container container)
		{
			int data = container.MembersModified.get_Data();
			object name = container.Name;
			object newName = container.NewName;
			object obj = ARTypeMgr.Instance.toVariant(container.Permissions);
			object obj2 = ARTypeMgr.Instance.toVariant(container.AdminGroups);
			object obj3 = ARTypeMgr.Instance.toVariant(container.ContainerOwners);
			object label = container.Label;
			object description = container.Description;
			object obj4;
			if (container is ActiveLinkGuide)
			{
				obj4 = 1;
			}
			else
			{
				if (container is ApplicationContainer)
				{
					obj4 = 2;
					((ApplicationContainer)container).SaveRefs(this);
				}
				else
				{
					if (container is PackingList)
					{
						obj4 = 3;
						((PackingList)container).SaveRefs(this);
					}
					else
					{
						if (container is FilterGuide)
						{
							obj4 = 4;
						}
						else
						{
							if (container is WebServiceContainer)
							{
								obj4 = 5;
								((WebServiceContainer)container).SaveRefs(this);
							}
							else
							{
								obj4 = 3;
							}
						}
					}
				}
			}
			object obj5 = ARTypeMgr.Instance.toVariant(container.References);
			bool flag = false;
			object helpText = container.HelpText;
			object owner = container.Owner;
			object obj6 = (container.ChangeDiary != null) ? container.ChangeDiary.AppendedText : null;
			ARTypeMgr arg_159_0 = ARTypeMgr.Instance;
			string arg_159_1 = "BMC.ARSystem.FieldValueList";
			string arg_159_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj7 = arg_159_0.BuildVariantFromCustomDictionary(arg_159_1, arg_159_2, keyIndex, "ARValue", new int[]
			{
				1
			}, container.Properties);
			object[] v = new object[]
			{
				"ARSetContainer",
				this._control,
				data,
				name,
				newName,
				obj,
				obj2,
				obj3,
				label,
				description,
				obj4,
				obj5,
				flag,
				helpText,
				owner,
				obj6,
				obj7,
				container.ModificationLogLabel
			};
			object[] arg_200_0 = (object[])this._Eval(v);
		}
		public void CreateActiveLink(ActiveLink obj)
		{
			this.Session.CurrentObjectType = Server.ObjectType.ActiveLink;
			this.Session.SecondaryServerName = Session.MakeServerName(this.ServerName, this.ServerPort);
			this.Session.CurrentLocalForm = obj.PrimaryForm;
			this.Session.CurrentRemoteForm = obj.PrimaryForm;
			this.Session.CurrentFieldId = 8u;
			object obj2 = new object[]
			{
				1,
				ARTypeMgr.Instance.toVariant(obj.FormList)
			};
			object obj3 = ARTypeMgr.Instance.toVariant(obj.Permissions);
			object obj4 = this.ParseQualification(obj.PrimaryForm, obj.RunIfQualification);
			object obj5 = Util.ConvertToARActionList(obj.IfActions, true, this);
			object obj6 = Util.ConvertToARActionList(obj.ElseActions, true, this);
			string arg_C6_0 = obj.HelpText;
			string arg_CD_0 = obj.Owner;
			object obj7 = null;
			if (obj.ChangeDiary != null)
			{
				if (obj.ChangeDiary.AppendedText != null)
				{
					obj7 = obj.ChangeDiary.AppendedText;
				}
				else
				{
					if (obj.ChangeDiary.get_Count() > 0)
					{
						obj7 = obj.ChangeDiary[obj.ChangeDiary.get_Count() - 1].Text;
					}
				}
			}
			ARTypeMgr arg_155_0 = ARTypeMgr.Instance;
			string arg_155_1 = "BMC.ARSystem.FieldValueList";
			string arg_155_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj8 = arg_155_0.BuildVariantFromCustomDictionary(arg_155_1, arg_155_2, keyIndex, "ARValue", new int[]
			{
				1
			}, obj.Properties);
			object[] v = new object[]
			{
				"ARCreateActiveLink",
				this._control,
				obj.Name,
				obj.Order,
				obj2,
				obj3,
				obj.ExecuteMask,
				obj.ControlField,
				obj.FocusField,
				obj.Enabled ? 1 : 0,
				obj4,
				obj5,
				obj6,
				obj.HelpText,
				obj.Owner,
				obj7,
				obj8,
				obj.ErrorHandlerOption,
				obj.ErrorHandlerName,
				obj.ModificationLogLabel
			};
			object[] arg_24C_0 = (object[])this._Eval(v);
		}
		public void DeleteActiveLink(string name)
		{
			this.DeleteActiveLink(name, 0);
		}
		public void DeleteActiveLink(string name, int deleteOption)
		{
			this.DeleteActiveLink(name, deleteOption, null);
		}
		public void DeleteActiveLink(string name, int deleteOption, string modificationLogLabel)
		{
			this.DeleteObject("ARDeleteActiveLink", name, deleteOption, modificationLogLabel);
		}
		public ActiveLink GetActiveLink(string name)
		{
			object[] v = new object[]
			{
				"ARGetActiveLink",
				this._control,
				name
			};
			object[] rawData = (object[])this._Eval(v);
			return ActiveLink.createInstance(rawData, this);
		}
		public ArrayList GetListActiveLink()
		{
			return this.GetListActiveLink(null);
		}
		public ArrayList GetListActiveLink(string formName)
		{
			return this.GetListActiveLink(formName, new DateTime(1970, 1, 1));
		}
		public ArrayList GetListActiveLink(DateTime changedSince)
		{
			return this.GetListActiveLink(null, changedSince);
		}
		public ArrayList GetListActiveLink(string formName, DateTime changedSince)
		{
			return this.GetListObjectByForm("ARGetListActiveLink", formName, changedSince);
		}
		public void SetActiveLink(ActiveLink obj)
		{
			int data = obj.MembersModified.get_Data();
			object obj2 = new object[]
			{
				1,
				ARTypeMgr.Instance.toVariant(obj.FormList)
			};
			object obj3 = ARTypeMgr.Instance.toVariant(obj.Permissions);
			object obj4 = null;
			if (obj.RunIfQualification != null)
			{
				obj4 = this.ParseQualification(obj.PrimaryForm, obj.RunIfQualification);
			}
			object obj5 = Util.ConvertToARActionList(obj.IfActions, true, this);
			object obj6 = Util.ConvertToARActionList(obj.ElseActions, true, this);
			string arg_8B_0 = obj.HelpText;
			string arg_92_0 = obj.Owner;
			object obj7 = (obj.ChangeDiary != null) ? obj.ChangeDiary.AppendedText : null;
			ARTypeMgr arg_DE_0 = ARTypeMgr.Instance;
			string arg_DE_1 = "BMC.ARSystem.FieldValueList";
			string arg_DE_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj8 = arg_DE_0.BuildVariantFromCustomDictionary(arg_DE_1, arg_DE_2, keyIndex, "ARValue", new int[]
			{
				1
			}, obj.Properties);
			object[] v = new object[]
			{
				"ARSetActiveLink",
				this._control,
				data,
				obj.Name,
				obj.NewName,
				obj.Order,
				obj2,
				obj3,
				obj.ExecuteMask,
				obj.ControlField,
				obj.FocusField,
				obj.Enabled ? 1 : 0,
				obj4,
				obj5,
				obj6,
				obj.HelpText,
				obj.Owner,
				obj7,
				obj8,
				obj.ErrorHandlerOption,
				obj.ErrorHandlerName,
				obj.ModificationLogLabel
			};
			object[] arg_1EC_0 = (object[])this._Eval(v);
		}
		public void CreateFilter(Filter obj)
		{
			this.Session.CurrentObjectType = Server.ObjectType.Filter;
			this.Session.SecondaryServerName = Session.MakeServerName(this.ServerName, this.ServerPort);
			this.Session.CurrentLocalForm = obj.PrimaryForm;
			this.Session.CurrentRemoteForm = obj.PrimaryForm;
			this.Session.CurrentFieldId = 8u;
			object obj2 = new object[]
			{
				1,
				ARTypeMgr.Instance.toVariant(obj.FormList)
			};
			object obj3 = null;
			if (obj.RunIfQualification != null)
			{
				obj3 = this.ParseFilterQualification(obj.PrimaryForm, obj.RunIfQualification);
			}
			object obj4 = Util.ConvertToARActionList(obj.IfActions, false, this);
			object obj5 = Util.ConvertToARActionList(obj.ElseActions, false, this);
			object obj6 = null;
			if (obj.ChangeDiary != null)
			{
				if (obj.ChangeDiary.AppendedText != null)
				{
					obj6 = obj.ChangeDiary.AppendedText;
				}
				else
				{
					if (obj.ChangeDiary.get_Count() > 0)
					{
						obj6 = obj.ChangeDiary[obj.ChangeDiary.get_Count() - 1].Text;
					}
				}
			}
			ARTypeMgr arg_13F_0 = ARTypeMgr.Instance;
			string arg_13F_1 = "BMC.ARSystem.FieldValueList";
			string arg_13F_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj7 = arg_13F_0.BuildVariantFromCustomDictionary(arg_13F_1, arg_13F_2, keyIndex, "ARValue", new int[]
			{
				1
			}, obj.Properties);
			object[] v = new object[]
			{
				"ARCreateFilter",
				this._control,
				obj.Name,
				obj.Order,
				obj2,
				obj.OpSet,
				obj.Enabled ? 1 : 0,
				obj3,
				obj4,
				obj5,
				obj.HelpText,
				obj.Owner,
				obj6,
				obj7,
				obj.ErrorHandlerOption,
				obj.ErrorHandlerName,
				obj.ModificationLogLabel
			};
			object[] arg_20F_0 = (object[])this._Eval(v);
		}
		public void DeleteFilter(string name)
		{
			this.DeleteFilter(name, 0);
		}
		public void DeleteFilter(string name, int deleteOption)
		{
			this.DeleteFilter(name, deleteOption, null);
		}
		public void DeleteFilter(string name, int deleteOption, string modificationLogLabel)
		{
			this.DeleteObject("ARDeleteFilter", name, deleteOption, modificationLogLabel);
		}
		public Filter GetFilter(string name)
		{
			object[] v = new object[]
			{
				"ARGetFilter",
				this._control,
				name
			};
			object[] rawData = (object[])this._Eval(v);
			return Filter.createInstance(rawData, this);
		}
		public ArrayList GetListFilter()
		{
			return this.GetListFilter(null);
		}
		public ArrayList GetListFilter(string formName)
		{
			return this.GetListFilter(formName, new DateTime(1970, 1, 1));
		}
		public ArrayList GetListFilter(DateTime changedSince)
		{
			return this.GetListFilter(null, changedSince);
		}
		public ArrayList GetListFilter(string formName, DateTime changedSince)
		{
			return this.GetListObjectByForm("ARGetListFilter", formName, changedSince);
		}
		public void SetFilter(Filter obj)
		{
			int data = obj.MembersModified.get_Data();
			object obj2 = new object[]
			{
				1,
				ARTypeMgr.Instance.toVariant(obj.FormList)
			};
			object obj3 = null;
			if (obj.RunIfQualification != null)
			{
				obj3 = this.ParseQualification(obj.PrimaryForm, obj.RunIfQualification);
			}
			object obj4 = Util.ConvertToARActionList(obj.IfActions, false, this);
			object obj5 = Util.ConvertToARActionList(obj.ElseActions, false, this);
			object obj6 = (obj.ChangeDiary != null) ? obj.ChangeDiary.AppendedText : null;
			ARTypeMgr arg_BE_0 = ARTypeMgr.Instance;
			string arg_BE_1 = "BMC.ARSystem.FieldValueList";
			string arg_BE_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj7 = arg_BE_0.BuildVariantFromCustomDictionary(arg_BE_1, arg_BE_2, keyIndex, "ARValue", new int[]
			{
				1
			}, obj.Properties);
			object[] v = new object[]
			{
				"ARSetFilter",
				this._control,
				data,
				obj.Name,
				obj.NewName,
				obj.Order,
				obj2,
				obj.OpSet,
				obj.Enabled ? 1 : 0,
				obj3,
				obj4,
				obj5,
				obj.HelpText,
				obj.Owner,
				obj6,
				obj7,
				obj.ErrorHandlerOption,
				obj.ErrorHandlerName,
				obj.ModificationLogLabel
			};
			object[] arg_1A5_0 = (object[])this._Eval(v);
		}
		public void CreateEscalation(Escalation obj)
		{
			this.Session.CurrentObjectType = Server.ObjectType.Escalation;
			object obj2 = ARTypeMgr.Instance.toVariant(obj.TimeCriteria);
			this.Session.SecondaryServerName = Session.MakeServerName(this.ServerName, this.ServerPort);
			this.Session.CurrentLocalForm = obj.PrimaryForm;
			this.Session.CurrentRemoteForm = obj.PrimaryForm;
			this.Session.CurrentFieldId = 8u;
			object obj3 = new object[]
			{
				1,
				ARTypeMgr.Instance.toVariant(obj.FormList)
			};
			object obj4 = this.ParseQualification(obj.PrimaryForm, obj.RunIfQualification);
			object obj5 = Util.ConvertToARActionList(obj.IfActions, false, this);
			object obj6 = Util.ConvertToARActionList(obj.ElseActions, false, this);
			object obj7 = null;
			if (obj.ChangeDiary != null)
			{
				if (obj.ChangeDiary.AppendedText != null)
				{
					obj7 = obj.ChangeDiary.AppendedText;
				}
				else
				{
					if (obj.ChangeDiary.get_Count() > 0)
					{
						obj7 = obj.ChangeDiary[obj.ChangeDiary.get_Count() - 1].Text;
					}
				}
			}
			ARTypeMgr arg_148_0 = ARTypeMgr.Instance;
			string arg_148_1 = "BMC.ARSystem.FieldValueList";
			string arg_148_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj8 = arg_148_0.BuildVariantFromCustomDictionary(arg_148_1, arg_148_2, keyIndex, "ARValue", new int[]
			{
				1
			}, obj.Properties);
			object[] v = new object[]
			{
				"ARCreateEscalation",
				this._control,
				obj.Name,
				obj2,
				obj3,
				obj.Enabled ? 1 : 0,
				obj4,
				obj5,
				obj6,
				obj.HelpText,
				obj.Owner,
				obj7,
				obj8,
				obj.ModificationLogLabel
			};
			object[] arg_1E4_0 = (object[])this._Eval(v);
		}
		public void DeleteEscalation(string name)
		{
			this.DeleteEscalation(name, 0);
		}
		public void DeleteEscalation(string name, int deleteOption)
		{
			this.DeleteEscalation(name, deleteOption, null);
		}
		public void DeleteEscalation(string name, int deleteOption, string modificationLogLabel)
		{
			this.DeleteObject("ARDeleteEscalation", name, deleteOption, modificationLogLabel);
		}
		public Escalation GetEscalation(string name)
		{
			object[] v = new object[]
			{
				"ARGetEscalation",
				this._control,
				name
			};
			object[] rawData = (object[])this._Eval(v);
			return Escalation.createInstance(rawData, this);
		}
		public ArrayList GetListEscalation()
		{
			return this.GetListEscalation(null);
		}
		public ArrayList GetListEscalation(string formName)
		{
			return this.GetListEscalation(formName, new DateTime(1970, 1, 1));
		}
		public ArrayList GetListEscalation(DateTime changedSince)
		{
			return this.GetListEscalation(null, changedSince);
		}
		public ArrayList GetListEscalation(string formName, DateTime changedSince)
		{
			return this.GetListObjectByForm("ARGetListEscalation", formName, changedSince);
		}
		public void SetEscalation(Escalation obj)
		{
			int data = obj.MembersModified.get_Data();
			object obj2 = ARTypeMgr.Instance.toVariant(obj.TimeCriteria);
			object obj3 = new object[]
			{
				1,
				ARTypeMgr.Instance.toVariant(obj.FormList)
			};
			object runIfQualification = obj.RunIfQualification;
			object obj4 = Util.ConvertToARActionList(obj.IfActions, false, this);
			object obj5 = Util.ConvertToARActionList(obj.ElseActions, false, this);
			object obj6 = (obj.ChangeDiary != null) ? obj.ChangeDiary.AppendedText : null;
			ARTypeMgr arg_BA_0 = ARTypeMgr.Instance;
			string arg_BA_1 = "BMC.ARSystem.FieldValueList";
			string arg_BA_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj7 = arg_BA_0.BuildVariantFromCustomDictionary(arg_BA_1, arg_BA_2, keyIndex, "ARValue", new int[]
			{
				1
			}, obj.Properties);
			object[] v = new object[]
			{
				"ARSetEscalation",
				this._control,
				data,
				obj.Name,
				obj.NewName,
				obj2,
				obj3,
				obj.Enabled ? 1 : 0,
				runIfQualification,
				obj4,
				obj5,
				obj.HelpText,
				obj.Owner,
				obj6,
				obj7,
				obj.ModificationLogLabel
			};
			object[] arg_16D_0 = (object[])this._Eval(v);
		}
		public void SetMenu(Menu menu)
		{
			this.Session.CurrentObjectType = Server.ObjectType.Menu;
			int data = menu.MembersModified.get_Data();
			object name = menu.Name;
			object newName = menu.NewName;
			object[] array = new object[2];
			if (menu is ListMenu)
			{
				array[0] = 1;
				ListMenu listMenu = menu as ListMenu;
				array[1] = ARTypeMgr.Instance.toVariant(listMenu.Content);
			}
			else
			{
				if (menu is QueryMenu)
				{
					array[0] = 2;
					QueryMenu queryMenu = menu as QueryMenu;
					this.Session.CurrentLocalForm = queryMenu.Form;
					array[1] = new object[]
					{
						queryMenu.Form,
						queryMenu.Server,
						queryMenu.Qualification,
						ARTypeMgr.Instance.toVariant(queryMenu.LabelFields),
						queryMenu.ValueField,
						queryMenu.SortOnLabel,
						queryMenu.SampleForm,
						queryMenu.SampleServer
					};
				}
				else
				{
					if (menu is FileMenu)
					{
						array[0] = 3;
						FileMenu fileMenu = menu as FileMenu;
						array[1] = new object[]
						{
							fileMenu.FileLocation,
							fileMenu.Filename
						};
					}
					else
					{
						if (menu is SqlMenu)
						{
							array[0] = 4;
							SqlMenu sqlMenu = menu as SqlMenu;
							array[1] = new object[]
							{
								sqlMenu.Server,
								sqlMenu.SqlCommand,
								ARTypeMgr.Instance.toVariant(sqlMenu.LabelIndexes),
								sqlMenu.ValueIndex
							};
						}
						else
						{
							if (menu is DataDictionaryMenu)
							{
								array[0] = 6;
								if (menu is FormDataDictionaryMenu)
								{
									FormDataDictionaryMenu formDataDictionaryMenu = menu as FormDataDictionaryMenu;
									array[1] = new object[]
									{
										formDataDictionaryMenu.Server,
										formDataDictionaryMenu.NameType,
										formDataDictionaryMenu.ValueFormat,
										1,
										new object[]
										{
											formDataDictionaryMenu.FormType,
											formDataDictionaryMenu.IncludeHidden
										}
									};
								}
								else
								{
									FieldDataDictionaryMenu fieldDataDictionaryMenu = menu as FieldDataDictionaryMenu;
									array[1] = new object[]
									{
										fieldDataDictionaryMenu.Server,
										fieldDataDictionaryMenu.NameType,
										fieldDataDictionaryMenu.ValueFormat,
										2,
										new object[]
										{
											fieldDataDictionaryMenu.FieldType,
											fieldDataDictionaryMenu.Form
										}
									};
								}
							}
							else
							{
								array[0] = 1;
							}
						}
					}
				}
			}
			object helpText = menu.HelpText;
			object owner = menu.Owner;
			object obj = (menu.ChangeDiary != null) ? menu.ChangeDiary.AppendedText : null;
			ARTypeMgr arg_32A_0 = ARTypeMgr.Instance;
			string arg_32A_1 = "BMC.ARSystem.FieldValueList";
			string arg_32A_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj2 = arg_32A_0.BuildVariantFromCustomDictionary(arg_32A_1, arg_32A_2, keyIndex, "ARValue", new int[]
			{
				1
			}, menu.Properties);
			object modificationLogLabel = menu.ModificationLogLabel;
			object[] v = new object[]
			{
				"ARSetCharMenu",
				this._control,
				data,
				name,
				newName,
				menu.RefreshCode,
				array,
				helpText,
				owner,
				obj,
				obj2,
				modificationLogLabel
			};
			object[] arg_3AF_0 = (object[])this._Eval(v);
		}
		public void CreateMenu(Menu menu)
		{
			this.Session.CurrentObjectType = Server.ObjectType.Menu;
			object name = menu.Name;
			object[] array = new object[2];
			if (menu is ListMenu)
			{
				array[0] = 1;
				ListMenu listMenu = menu as ListMenu;
				array[1] = ARTypeMgr.Instance.toVariant(listMenu.Content);
			}
			else
			{
				if (menu is QueryMenu)
				{
					array[0] = 2;
					QueryMenu queryMenu = menu as QueryMenu;
					this.Session.CurrentLocalForm = queryMenu.Form;
					Server server = this.Session.GetServer(queryMenu.Server);
					object obj = server.ParseQualification(queryMenu.Form, queryMenu.Qualification);
					array[1] = new object[]
					{
						queryMenu.Form,
						queryMenu.Server,
						obj,
						ARTypeMgr.Instance.toVariant(queryMenu.LabelFields),
						queryMenu.ValueField,
						queryMenu.SortOnLabel,
						queryMenu.SampleForm,
						queryMenu.SampleServer
					};
				}
				else
				{
					if (menu is FileMenu)
					{
						array[0] = 3;
						FileMenu fileMenu = menu as FileMenu;
						array[1] = new object[]
						{
							fileMenu.FileLocation,
							fileMenu.Filename
						};
					}
					else
					{
						if (menu is SqlMenu)
						{
							array[0] = 4;
							SqlMenu sqlMenu = menu as SqlMenu;
							array[1] = new object[]
							{
								sqlMenu.Server,
								sqlMenu.SqlCommand,
								ARTypeMgr.Instance.toVariant(sqlMenu.LabelIndexes),
								sqlMenu.ValueIndex
							};
						}
						else
						{
							if (menu is DataDictionaryMenu)
							{
								array[0] = 6;
								if (menu is FormDataDictionaryMenu)
								{
									FormDataDictionaryMenu formDataDictionaryMenu = menu as FormDataDictionaryMenu;
									array[1] = new object[]
									{
										formDataDictionaryMenu.Server,
										formDataDictionaryMenu.NameType,
										formDataDictionaryMenu.ValueFormat,
										1,
										new object[]
										{
											formDataDictionaryMenu.FormType,
											formDataDictionaryMenu.IncludeHidden
										}
									};
								}
								else
								{
									FieldDataDictionaryMenu fieldDataDictionaryMenu = menu as FieldDataDictionaryMenu;
									array[1] = new object[]
									{
										fieldDataDictionaryMenu.Server,
										fieldDataDictionaryMenu.NameType,
										fieldDataDictionaryMenu.ValueFormat,
										2,
										new object[]
										{
											fieldDataDictionaryMenu.FieldType,
											fieldDataDictionaryMenu.Form
										}
									};
								}
							}
							else
							{
								array[0] = 1;
							}
						}
					}
				}
			}
			object helpText = menu.HelpText;
			object owner = menu.Owner;
			object obj2 = (menu.ChangeDiary != null) ? menu.ChangeDiary.AppendedText : null;
			ARTypeMgr arg_32B_0 = ARTypeMgr.Instance;
			string arg_32B_1 = "BMC.ARSystem.FieldValueList";
			string arg_32B_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj3 = arg_32B_0.BuildVariantFromCustomDictionary(arg_32B_1, arg_32B_2, keyIndex, "ARValue", new int[]
			{
				1
			}, menu.Properties);
			object modificationLogLabel = menu.ModificationLogLabel;
			object[] v = new object[]
			{
				"ARCreateCharMenu",
				this._control,
				name,
				menu.RefreshCode,
				array,
				helpText,
				owner,
				obj2,
				obj3,
				modificationLogLabel
			};
			object[] arg_39F_0 = (object[])this._Eval(v);
		}
		public void DeleteMenu(string name)
		{
			this.DeleteMenu(name, 0);
		}
		public void DeleteMenu(string name, int deleteOption)
		{
			this.DeleteMenu(name, deleteOption, null);
		}
		public void DeleteMenu(string name, int deleteOption, string modificationLogLabel)
		{
			this.DeleteObject("ARDeleteCharMenu", name, deleteOption, modificationLogLabel);
		}
		public ArrayList ExpandMenu(string name)
		{
			FieldValueList fieldValueList = new FieldValueList();
			return this.ExpandMenu(name, fieldValueList);
		}
		public ArrayList ExpandMenu(string name, FieldValueList fieldValueList)
		{
			object obj = this.GetCharMenuInternal(name);
			obj = ((object[])obj)[5];
			ARTypeMgr arg_3F_0 = ARTypeMgr.Instance;
			string arg_3F_1 = "BMC.ARSystem.FieldValueList";
			string arg_3F_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj2 = arg_3F_0.BuildVariantFromCustomDictionary(arg_3F_1, arg_3F_2, keyIndex, "ARValue", new int[]
			{
				1
			}, fieldValueList);
			object[] v = new object[]
			{
				"ARExpandCharMenu",
				this._control,
				obj,
				obj2
			};
			object[] array = (object[])this._Eval(v);
			return Util.BuildExpMenuResponse(array[4]);
		}
		public ArrayList ExpandMenu(string name, FieldValueList fieldValueList, uint maxRetrieve, out uint numMatches)
		{
			object obj = this.GetCharMenuInternal(name);
			obj = ((object[])obj)[5];
			ARTypeMgr arg_3F_0 = ARTypeMgr.Instance;
			string arg_3F_1 = "BMC.ARSystem.FieldValueList";
			string arg_3F_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj2 = arg_3F_0.BuildVariantFromCustomDictionary(arg_3F_1, arg_3F_2, keyIndex, "ARValue", new int[]
			{
				1
			}, fieldValueList);
			object[] v = new object[]
			{
				"ARExpandCharMenu",
				this._control,
				obj,
				obj2,
				maxRetrieve
			};
			object[] array = (object[])this._Eval(v);
			numMatches = (uint)array[5];
			return Util.BuildExpMenuResponse(array[4]);
		}
		public Menu GetMenu(string name)
		{
			object[] charMenuInternal = this.GetCharMenuInternal(name);
			return Menu.createInstance(charMenuInternal, this);
		}
		public ArrayList GetListMenu()
		{
			return this.GetListMenu(null);
		}
		public ArrayList GetListMenu(string formName)
		{
			return this.GetListMenu(formName, new DateTime(1970, 1, 1));
		}
		public ArrayList GetListMenu(DateTime changedSince)
		{
			return this.GetListMenu(null, changedSince);
		}
		public ArrayList GetListMenu(string formName, DateTime changedSince)
		{
			object obj = Util.GetARTimestamp(changedSince);
			object[] v = new object[]
			{
				"ARGetListCharMenu",
				this._control,
				obj,
				(formName != null && formName.get_Length() > 0) ? new object[]
				{
					formName
				} : null
			};
			object[] array = (object[])this._Eval(v);
			return new ArrayList((object[])array[7]);
		}
		public uint CreateField(Field field)
		{
			object formName = field.FormName;
			object obj = field.Id;
			object obj2 = true;
			object name = field.Name;
			object[] array = new object[2];
			FieldMapping fieldMapping = field.FieldMapping;
			if (fieldMapping is RegularFieldMapping)
			{
				array[0] = 1;
			}
			else
			{
				if (fieldMapping is JoinFieldMapping)
				{
					array[0] = 2;
					array[1] = new object[]
					{
						((JoinFieldMapping)fieldMapping).FormIndex,
						((JoinFieldMapping)fieldMapping).RealId
					};
				}
				else
				{
					if (fieldMapping is ViewFieldMapping)
					{
						array[0] = 3;
						array[1] = new object[]
						{
							((ViewFieldMapping)fieldMapping).FieldName
						};
					}
					else
					{
						if (fieldMapping is VendorFieldMapping)
						{
							array[0] = 4;
							array[1] = new object[]
							{
								((VendorFieldMapping)fieldMapping).FieldName
							};
						}
						else
						{
							array[0] = 0;
						}
					}
				}
			}
			object obj3 = field.DataType;
			object obj4 = field.FieldOption;
			object obj5 = field.CreateMode;
			object obj6 = field.AuditOption;
			object obj7 = Util.ConvertToARValue(field.DefaultValue);
			if (obj7 != null && ((object[])obj7)[0] is int && (int)((object[])obj7)[0] != 0 && (field.DataType == 6u || field.DataType == 8u))
			{
				((object[])obj7)[0] = (int)field.DataType;
			}
			object obj8 = ARTypeMgr.Instance.toVariant(field.Permissions);
			object[] array2 = new object[2];
			Limit limit = field.Limit;
			if (limit is IntegerLimit)
			{
				array2[0] = 2;
				array2[1] = new object[]
				{
					((IntegerLimit)limit).RangeLow,
					((IntegerLimit)limit).RangeHigh
				};
			}
			else
			{
				if (limit is RealLimit)
				{
					array2[0] = 3;
					RealLimit realLimit = limit as RealLimit;
					array2[1] = new object[]
					{
						realLimit.RangeLow,
						realLimit.RangeHigh,
						realLimit.Precision
					};
				}
				else
				{
					if (limit is CharacterLimit)
					{
						array2[0] = 4;
						CharacterLimit given = limit as CharacterLimit;
						array2[1] = ARTypeMgr.Instance.toVariant(given);
					}
					else
					{
						if (limit is DiaryLimit)
						{
							array2[0] = 5;
							DiaryLimit given2 = limit as DiaryLimit;
							array2[1] = ARTypeMgr.Instance.toVariant(given2);
						}
						else
						{
							if (limit is SelectionLimit)
							{
								array2[0] = 6;
								SelectionLimit given3 = limit as SelectionLimit;
								array2[1] = ARTypeMgr.Instance.toVariant(given3);
							}
							else
							{
								if (limit is DateTimeLimit)
								{
									array2[0] = 7;
									DateTimeLimit given4 = limit as DateTimeLimit;
									array2[1] = ARTypeMgr.Instance.toVariant(given4);
								}
								else
								{
									if (limit is DecimalLimit)
									{
										array2[0] = 10;
										DecimalLimit given5 = limit as DecimalLimit;
										array2[1] = ARTypeMgr.Instance.toVariant(given5);
									}
									else
									{
										if (limit is AttachmentLimit)
										{
											array2[0] = 11;
											AttachmentLimit given6 = limit as AttachmentLimit;
											array2[1] = ARTypeMgr.Instance.toVariant(given6);
										}
										else
										{
											if (limit is CurrencyLimit)
											{
												array2[0] = 12;
												CurrencyLimit given7 = limit as CurrencyLimit;
												array2[1] = ARTypeMgr.Instance.toVariant(given7);
											}
											else
											{
												if (limit is DateOnlyLimit)
												{
													array2[0] = 13;
													DateOnlyLimit given8 = limit as DateOnlyLimit;
													array2[1] = ARTypeMgr.Instance.toVariant(given8);
												}
												else
												{
													if (limit is TimeOnlyLimit)
													{
														array2[0] = 14;
														TimeOnlyLimit given9 = limit as TimeOnlyLimit;
														array2[1] = ARTypeMgr.Instance.toVariant(given9);
													}
													else
													{
														if (limit is TableLimit)
														{
															array2[0] = 33;
															TableLimit given10 = limit as TableLimit;
															array2[1] = ARTypeMgr.Instance.toVariant(given10);
														}
														else
														{
															if (limit is ColumnLimit)
															{
																array2[0] = 34;
																ColumnLimit given11 = limit as ColumnLimit;
																array2[1] = ARTypeMgr.Instance.toVariant(given11);
															}
															else
															{
																array2[0] = 0;
																array2[1] = null;
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
			ARTypeMgr arg_4BE_0 = ARTypeMgr.Instance;
			string arg_4BE_1 = "ARDisplayInstanceList";
			string arg_4BE_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object[] array3 = (object[])arg_4BE_0.BuildVariantFromCustomDictionary(arg_4BE_1, arg_4BE_2, keyIndex, "BMC.ARSystem.DisplayInstance", new int[]
			{
				1
			}, field.DisplayInstanceList);
			Util.FixARDisplayProps("DisplayInstanceList", array3);
			object helpText = field.HelpText;
			object owner = field.Owner;
			object obj9 = (field.ChangeDiary != null) ? field.ChangeDiary.AppendedText : null;
			ARTypeMgr arg_531_0 = ARTypeMgr.Instance;
			string arg_531_1 = "BMC.ARSystem.FieldValueList";
			string arg_531_2 = "System.Int32";
			keyIndex = new int[1];
			object obj10 = arg_531_0.BuildVariantFromCustomDictionary(arg_531_1, arg_531_2, keyIndex, "ARValue", new int[]
			{
				1
			}, field.Properties);
			object[] v = new object[]
			{
				"ARCreateField",
				this._control,
				formName,
				obj,
				obj2,
				name,
				array,
				obj3,
				obj4,
				obj5,
				obj6,
				obj7,
				obj8,
				array2,
				new object[]
				{
					0,
					array3
				},
				helpText,
				owner,
				obj9,
				obj10
			};
			object[] array4 = (object[])this._Eval(v);
			field.Id = (uint)array4[4];
			return field.Id;
		}
		public void DeleteField(string name, uint id, Server.FieldDeleteOption deleteOption)
		{
			object[] v = new object[]
			{
				"ARDeleteField",
				this._control,
				name,
				id,
				(int)deleteOption
			};
			object[] arg_3C_0 = (object[])this._Eval(v);
		}
		public void DeleteFields(string name, uint[] fieldIdList, Server.FieldDeleteOption deleteOption)
		{
			object obj = ARTypeMgr.Instance.toVariant(fieldIdList);
			object[] v = new object[]
			{
				"ARDeleteMultipleFields",
				this._control,
				name,
				obj,
				(int)deleteOption
			};
			object[] arg_43_0 = (object[])this._Eval(v);
		}
		public Field GetField(string formName, uint id)
		{
			object[] v = new object[]
			{
				"ARGetField",
				this._control,
				formName,
				id
			};
			object[] rawData = (object[])this._Eval(v);
			return Field.createInstance(rawData, this);
		}
		public ArrayList GetListField(string formName)
		{
			return this.GetListField(formName, 511);
		}
		public ArrayList GetListField(string formName, int fieldType)
		{
			return this.GetListField(formName, fieldType, new DateTime(1970, 1, 1));
		}
		public ArrayList GetListField(string formName, int fieldType, DateTime changedSince)
		{
			return this.GetListField(formName, fieldType, changedSince, null);
		}
		public ArrayList GetListField(string formName, int fieldType, DateTime changedSince, IDictionary objPropList)
		{
			object obj = Util.GetARTimestamp(changedSince);
			ARTypeMgr arg_3B_0 = ARTypeMgr.Instance;
			string arg_3B_1 = "BMC.ARSystem.FieldValueList";
			string arg_3B_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj2 = arg_3B_0.BuildVariantFromCustomDictionary(arg_3B_1, arg_3B_2, keyIndex, "ARValue", new int[]
			{
				1
			}, objPropList);
			object[] v = new object[]
			{
				"ARGetListField",
				this._control,
				formName,
				fieldType,
				obj,
				obj2
			};
			object[] array = (object[])this._Eval(v);
			return new ArrayList((object[])array[7]);
		}
		public void SetField(Field field)
		{
			int data = field.MembersModified.get_Data();
			object formName = field.FormName;
			object obj = field.Id;
			object name = field.Name;
			object[] array = new object[2];
			FieldMapping fieldMapping = field.FieldMapping;
			if (fieldMapping is RegularFieldMapping)
			{
				array[0] = 1;
			}
			else
			{
				if (fieldMapping is JoinFieldMapping)
				{
					array[0] = 2;
					array[1] = new object[]
					{
						((JoinFieldMapping)fieldMapping).FormIndex,
						((JoinFieldMapping)fieldMapping).RealId
					};
				}
				else
				{
					if (fieldMapping is ViewFieldMapping)
					{
						array[0] = 3;
						array[1] = new object[]
						{
							((ViewFieldMapping)fieldMapping).FieldName
						};
					}
					else
					{
						if (fieldMapping is VendorFieldMapping)
						{
							array[0] = 4;
							array[1] = new object[]
							{
								((VendorFieldMapping)fieldMapping).FieldName
							};
						}
						else
						{
							array[0] = 0;
						}
					}
				}
			}
			object obj2 = field.FieldOption;
			object obj3 = field.CreateMode;
			object obj4 = field.AuditOption;
			object obj5 = Util.ConvertToARValue(field.DefaultValue);
			if (obj5 != null && ((object[])obj5)[0] is int && (int)((object[])obj5)[0] != 0 && (field.DataType == 6u || field.DataType == 8u))
			{
				((object[])obj5)[0] = (int)field.DataType;
			}
			object obj6 = ARTypeMgr.Instance.toVariant(field.Permissions);
			object[] array2 = new object[2];
			Limit limit = field.Limit;
			if (limit is IntegerLimit)
			{
				array2[0] = 2;
				array2[1] = new object[]
				{
					((IntegerLimit)limit).RangeLow,
					((IntegerLimit)limit).RangeHigh
				};
			}
			else
			{
				if (limit is RealLimit)
				{
					array2[0] = 3;
					RealLimit realLimit = limit as RealLimit;
					array2[1] = new object[]
					{
						realLimit.RangeLow,
						realLimit.RangeHigh,
						realLimit.Precision
					};
				}
				else
				{
					if (limit is CharacterLimit)
					{
						array2[0] = 4;
						CharacterLimit given = limit as CharacterLimit;
						array2[1] = ARTypeMgr.Instance.toVariant(given);
					}
					else
					{
						if (limit is DiaryLimit)
						{
							array2[0] = 5;
							DiaryLimit given2 = limit as DiaryLimit;
							array2[1] = ARTypeMgr.Instance.toVariant(given2);
						}
						else
						{
							if (limit is SelectionLimit)
							{
								array2[0] = 6;
								SelectionLimit given3 = limit as SelectionLimit;
								array2[1] = ARTypeMgr.Instance.toVariant(given3);
							}
							else
							{
								if (limit is DateTimeLimit)
								{
									array2[0] = 7;
									DateTimeLimit given4 = limit as DateTimeLimit;
									array2[1] = ARTypeMgr.Instance.toVariant(given4);
								}
								else
								{
									if (limit is DecimalLimit)
									{
										array2[0] = 10;
										DecimalLimit given5 = limit as DecimalLimit;
										array2[1] = ARTypeMgr.Instance.toVariant(given5);
									}
									else
									{
										if (limit is AttachmentLimit)
										{
											array2[0] = 11;
											AttachmentLimit given6 = limit as AttachmentLimit;
											array2[1] = ARTypeMgr.Instance.toVariant(given6);
										}
										else
										{
											if (limit is CurrencyLimit)
											{
												array2[0] = 12;
												CurrencyLimit given7 = limit as CurrencyLimit;
												array2[1] = ARTypeMgr.Instance.toVariant(given7);
											}
											else
											{
												if (limit is DateOnlyLimit)
												{
													array2[0] = 13;
													DateOnlyLimit given8 = limit as DateOnlyLimit;
													array2[1] = ARTypeMgr.Instance.toVariant(given8);
												}
												else
												{
													if (limit is TimeOnlyLimit)
													{
														array2[0] = 14;
														TimeOnlyLimit given9 = limit as TimeOnlyLimit;
														array2[1] = ARTypeMgr.Instance.toVariant(given9);
													}
													else
													{
														if (limit is TableLimit)
														{
															array2[0] = 33;
															TableLimit given10 = limit as TableLimit;
															array2[1] = ARTypeMgr.Instance.toVariant(given10);
														}
														else
														{
															if (limit is ColumnLimit)
															{
																array2[0] = 34;
																ColumnLimit given11 = limit as ColumnLimit;
																array2[1] = ARTypeMgr.Instance.toVariant(given11);
															}
															else
															{
																array2[0] = 0;
																array2[1] = null;
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
			ARTypeMgr arg_4BA_0 = ARTypeMgr.Instance;
			string arg_4BA_1 = "ARDisplayInstanceList";
			string arg_4BA_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object[] array3 = (object[])arg_4BA_0.BuildVariantFromCustomDictionary(arg_4BA_1, arg_4BA_2, keyIndex, "BMC.ARSystem.DisplayInstance", new int[]
			{
				1
			}, field.DisplayInstanceList);
			Util.FixARDisplayProps("DisplayInstanceList", array3);
			object helpText = field.HelpText;
			object owner = field.Owner;
			object obj7 = (field.ChangeDiary != null) ? field.ChangeDiary.AppendedText : null;
			ARTypeMgr arg_52D_0 = ARTypeMgr.Instance;
			string arg_52D_1 = "BMC.ARSystem.FieldValueList";
			string arg_52D_2 = "System.Int32";
			keyIndex = new int[1];
			object obj8 = arg_52D_0.BuildVariantFromCustomDictionary(arg_52D_1, arg_52D_2, keyIndex, "ARValue", new int[]
			{
				1
			}, field.Properties);
			object[] v = new object[]
			{
				"ARSetField",
				this._control,
				data,
				formName,
				obj,
				name,
				array,
				obj2,
				obj3,
				obj4,
				obj5,
				obj6,
				array2,
				new object[]
				{
					0,
					array3
				},
				helpText,
				owner,
				obj7,
				obj8
			};
			object[] array4 = (object[])this._Eval(v);
			field.Id = (uint)array4[4];
		}
		public Hashtable GetAllFields(string form)
		{
			Hashtable hashtable = new Hashtable();
			ArrayList listField = this.GetListField(form, 511);
			IEnumerator enumerator = listField.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					uint num = (uint)enumerator.get_Current();
					Field field = this.GetField(form, num);
					hashtable.set_Item(num, field);
				}
			}
			finally
			{
				IDisposable disposable = enumerator as IDisposable;
				if (disposable != null)
				{
					disposable.Dispose();
				}
			}
			return hashtable;
		}
		public uint CreateVui(Vui vui)
		{
			object formName = vui.FormName;
			object obj = vui.Id;
			object name = vui.Name;
			object locale = vui.Locale;
			object obj2 = vui.VuiType;
			ARTypeMgr arg_61_0 = ARTypeMgr.Instance;
			string arg_61_1 = "BMC.ARSystem.FieldValueList";
			string arg_61_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj3 = arg_61_0.BuildVariantFromCustomDictionary(arg_61_1, arg_61_2, keyIndex, "ARPropValue", new int[]
			{
				1
			}, vui.Properties);
			object helpText = vui.HelpText;
			object owner = vui.Owner;
			object obj4 = (vui.ChangeDiary != null) ? vui.ChangeDiary.AppendedText : null;
			object[] v = new object[]
			{
				"ARCreateVui",
				this._control,
				formName,
				obj,
				name,
				locale,
				obj2,
				obj3,
				helpText,
				owner,
				obj4,
				vui.AssignedName
			};
			object[] array = (object[])this._Eval(v);
			vui.Id = (uint)array[4];
			return vui.Id;
		}
		public void DeleteVui(string formName, uint vuiId)
		{
			object[] v = new object[]
			{
				"ARDeleteVui",
				this._control,
				formName,
				vuiId
			};
			object[] arg_33_0 = (object[])this._Eval(v);
		}
		public Vui GetVui(string formName, uint id)
		{
			object[] v = new object[]
			{
				"ARGetVUI",
				this._control,
				formName,
				id
			};
			object[] rawData = (object[])this._Eval(v);
			return Vui.createInstance(rawData, this);
		}
		public ArrayList GetListVui(string formName)
		{
			return this.GetListVui(formName, new DateTime(1970, 1, 1), null);
		}
		public ArrayList GetListVui(string formName, DateTime changedSince, IDictionary objPropList)
		{
			object obj = Util.GetARTimestamp(changedSince);
			ARTypeMgr arg_3A_0 = ARTypeMgr.Instance;
			string arg_3A_1 = "BMC.ARSystem.FieldValueList";
			string arg_3A_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj2 = arg_3A_0.BuildVariantFromCustomDictionary(arg_3A_1, arg_3A_2, keyIndex, "ARValue", new int[]
			{
				1
			}, objPropList);
			object[] v = new object[]
			{
				"ARGetListVui",
				this._control,
				formName,
				obj,
				obj2
			};
			object[] array = (object[])this._Eval(v);
			return new ArrayList((object[])array[6]);
		}
		public void SetVui(Vui vui)
		{
			int data = vui.MembersModified.get_Data();
			object formName = vui.FormName;
			object obj = vui.Id;
			object name = vui.Name;
			object locale = vui.Locale;
			object obj2 = vui.VuiType;
			ARTypeMgr arg_72_0 = ARTypeMgr.Instance;
			string arg_72_1 = "BMC.ARSystem.FieldValueList";
			string arg_72_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj3 = arg_72_0.BuildVariantFromCustomDictionary(arg_72_1, arg_72_2, keyIndex, "ARPropValue", new int[]
			{
				1
			}, vui.Properties);
			Util.FixARDisplayProps("PropList", obj3);
			object helpText = vui.HelpText;
			object owner = vui.Owner;
			object obj4 = (vui.ChangeDiary != null) ? vui.ChangeDiary.AppendedText : null;
			ARTypeMgr arg_E0_0 = ARTypeMgr.Instance;
			string arg_E0_1 = "BMC.ARSystem.FieldValueList";
			string arg_E0_2 = "System.Int32";
			keyIndex = new int[1];
			object obj5 = arg_E0_0.BuildVariantFromCustomDictionary(arg_E0_1, arg_E0_2, keyIndex, "ARPropValue", new int[]
			{
				1
			}, vui.ObjProperties);
			object[] v = new object[]
			{
				"ARSetVui",
				this._control,
				data,
				formName,
				obj,
				name,
				locale,
				obj2,
				obj3,
				helpText,
				owner,
				obj4,
				obj5
			};
			object[] array = (object[])this._Eval(v);
			vui.Id = (uint)array[4];
		}
		public Image GetImage(string name)
		{
			object[] v = new object[]
			{
				"ARGetImage",
				this._control,
				name
			};
			object[] rawData = (object[])this._Eval(v);
			return Image.createInstance(rawData, this);
		}
		public void DeleteImage(string name, bool updateReferences)
		{
			this.DeleteImage(name, updateReferences, null);
		}
		public void DeleteImage(string name, bool updateReferences, string modificationLogLabel)
		{
			object[] v = new object[]
			{
				"ARDeleteImage",
				this._control,
				name,
				Convert.ToInt16(updateReferences),
				modificationLogLabel
			};
			object[] arg_3C_0 = (object[])this._Eval(v);
		}
		public void CreateImage(Image obj)
		{
			this.Session.CurrentObjectType = Server.ObjectType.Image;
			object obj2 = null;
			if (obj.ChangeDiary != null)
			{
				if (obj.ChangeDiary.AppendedText != null)
				{
					obj2 = obj.ChangeDiary.AppendedText;
				}
				else
				{
					if (obj.ChangeDiary.get_Count() > 0)
					{
						obj2 = obj.ChangeDiary[obj.ChangeDiary.get_Count() - 1].Text;
					}
				}
			}
			ARTypeMgr arg_91_0 = ARTypeMgr.Instance;
			string arg_91_1 = "BMC.ARSystem.FieldValueList";
			string arg_91_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj3 = arg_91_0.BuildVariantFromCustomDictionary(arg_91_1, arg_91_2, keyIndex, "ARValue", new int[]
			{
				1
			}, obj.Properties);
			object[] array = new object[]
			{
				ARTypeMgr.Instance.toVariant(obj.Content.Length),
				ARTypeMgr.Instance.toVariant(obj.Content)
			};
			object[] v = new object[]
			{
				"ARCreateImage",
				this._control,
				obj.Name,
				array,
				obj.Type,
				obj.Description,
				obj.HelpText,
				obj.Owner,
				obj2,
				obj3,
				obj.ModificationLogLabel
			};
			object[] arg_143_0 = (object[])this._Eval(v);
		}
		public void SetImage(Image obj)
		{
			int data = obj.MembersModified.get_Data();
			object obj2 = null;
			if (obj.ChangeDiary != null)
			{
				if (obj.ChangeDiary.AppendedText != null)
				{
					obj2 = obj.ChangeDiary.AppendedText;
				}
				else
				{
					if (obj.ChangeDiary.get_Count() > 0)
					{
						obj2 = obj.ChangeDiary[obj.ChangeDiary.get_Count() - 1].Text;
					}
				}
			}
			ARTypeMgr arg_94_0 = ARTypeMgr.Instance;
			string arg_94_1 = "BMC.ARSystem.FieldValueList";
			string arg_94_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj3 = arg_94_0.BuildVariantFromCustomDictionary(arg_94_1, arg_94_2, keyIndex, "ARValue", new int[]
			{
				1
			}, obj.Properties);
			object[] array = null;
			if (obj.Content != null)
			{
				array = new object[]
				{
					ARTypeMgr.Instance.toVariant(obj.Content.Length),
					ARTypeMgr.Instance.toVariant(obj.Content)
				};
			}
			object[] v = new object[]
			{
				"ARSetImage",
				this._control,
				data,
				obj.Name,
				obj.NewName,
				array,
				obj.Type,
				obj.Description,
				obj.HelpText,
				obj.Owner,
				obj2,
				obj3,
				obj.ModificationLogLabel
			};
			object[] arg_168_0 = (object[])this._Eval(v);
		}
		public ArrayList GetListImage(string schema)
		{
			return this.GetListImage(schema, new DateTime(1970, 1, 1));
		}
		public ArrayList GetListImage(string schema, DateTime changedSince)
		{
			return this.GetListImage(schema, changedSince, null);
		}
		public ArrayList GetListImage(string schema, DateTime changedSince, string imageType)
		{
			return this.GetListImage(schema, changedSince, imageType, null);
		}
		public ArrayList GetListImage(string schema, DateTime changedSince, string imageType, IDictionary objPropList)
		{
			object obj = Util.GetARTimestamp(changedSince);
			ARTypeMgr arg_3B_0 = ARTypeMgr.Instance;
			string arg_3B_1 = "BMC.ARSystem.FieldValueList";
			string arg_3B_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj2 = arg_3B_0.BuildVariantFromCustomDictionary(arg_3B_1, arg_3B_2, keyIndex, "ARValue", new int[]
			{
				1
			}, objPropList);
			object[] v = new object[]
			{
				"ARGetListImage",
				this._control,
				(schema != null && schema.get_Length() > 0) ? new object[]
				{
					schema
				} : null,
				obj,
				(imageType != null && imageType.get_Length() > 0) ? new object[]
				{
					imageType
				} : null,
				obj2
			};
			object[] array = (object[])this._Eval(v);
			return new ArrayList((object[])array[7]);
		}
		public FieldValueList GetEntry(string form, string entryId)
		{
			return this.GetEntry(form, entryId, null);
		}
		public FieldValueList GetEntry(string form, string entryId, FieldIdList fieldIdList)
		{
			return this.GetEntry(form, entryId, Util.ConvertToUInt32Array(fieldIdList));
		}
		public FieldValueList GetEntry(string form, string entryId, uint[] fieldIdList)
		{
			object obj = Util.StringToEntryId(entryId);
			object obj2 = ARTypeMgr.Instance.toVariant(fieldIdList);
			object[] v = new object[]
			{
				"ARGetEntry",
				this._control,
				form,
				obj,
				obj2
			};
			object[] array = (object[])this._Eval(v);
			ARTypeMgr arg_8C_0 = ARTypeMgr.Instance;
			Type arg_8C_1 = typeof(FieldValueList);
			string arg_8C_2 = "System.UInt32";
			int[] keyIndex = new int[1];
			IDictionary dictionary = arg_8C_0.BuildCustomDictionaryFromVariant(arg_8C_1, arg_8C_2, keyIndex, "ARValue", new int[]
			{
				1
			}, (object[])array[6], this);
			return (FieldValueList)dictionary;
		}
		public void DeleteEntry(string form, string entryId)
		{
			this.DeleteEntry(form, entryId, 0);
		}
		public void DeleteEntry(string form, string entryId, int deleteOption)
		{
			string[] given = entryId.Split(new char[]
			{
				'|'
			});
			object obj = ARTypeMgr.Instance.toVariant(given);
			object[] v = new object[]
			{
				"ARDeleteEntry",
				this._control,
				form,
				obj,
				deleteOption
			};
			object[] arg_63_0 = (object[])this._Eval(v);
		}
		public string CreateEntry(string form, FieldValueList fieldValueList)
		{
			ARTypeMgr arg_30_0 = ARTypeMgr.Instance;
			string arg_30_1 = "BMC.ARSystem.FieldValueList";
			string arg_30_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj = arg_30_0.BuildVariantFromCustomDictionary(arg_30_1, arg_30_2, keyIndex, "ARValue", new int[]
			{
				1
			}, fieldValueList);
			object[] v = new object[]
			{
				"ARCreateEntry",
				this._control,
				form,
				obj
			};
			object[] array = (object[])this._Eval(v);
			return (string)array[5];
		}
		public FieldValueList ExecuteService(string form, string entryId, FieldValueList fieldValueList, uint[] fieldIdList)
		{
			object obj = Util.StringToEntryId(entryId);
			ARTypeMgr arg_37_0 = ARTypeMgr.Instance;
			string arg_37_1 = "BMC.ARSystem.FieldValueList";
			string arg_37_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj2 = arg_37_0.BuildVariantFromCustomDictionary(arg_37_1, arg_37_2, keyIndex, "ARValue", new int[]
			{
				1
			}, fieldValueList);
			object obj3 = ARTypeMgr.Instance.toVariant(fieldIdList);
			object[] v = new object[]
			{
				"ARServiceEntry",
				this._control,
				form,
				obj,
				obj2,
				obj3
			};
			object[] array = (object[])this._Eval(v);
			ARTypeMgr arg_C8_0 = ARTypeMgr.Instance;
			Type arg_C8_1 = typeof(FieldValueList);
			string arg_C8_2 = "System.UInt32";
			keyIndex = new int[1];
			IDictionary dictionary = arg_C8_0.BuildCustomDictionaryFromVariant(arg_C8_1, arg_C8_2, keyIndex, "ARValue", new int[]
			{
				1
			}, (object[])array[7], this);
			return (FieldValueList)dictionary;
		}
		public void SetEntry(string form, string entryId, FieldValueList fieldValueList)
		{
			object obj = Util.StringToEntryId(entryId);
			ARTypeMgr arg_37_0 = ARTypeMgr.Instance;
			string arg_37_1 = "BMC.ARSystem.FieldValueList";
			string arg_37_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj2 = arg_37_0.BuildVariantFromCustomDictionary(arg_37_1, arg_37_2, keyIndex, "ARValue", new int[]
			{
				1
			}, fieldValueList);
			object[] v = new object[]
			{
				"ARSetEntry",
				this._control,
				form,
				obj,
				obj2
			};
			object[] arg_76_0 = (object[])this._Eval(v);
		}
		public FieldValueList SetGetEntry(string form, string entryId, FieldValueList setFieldValueList)
		{
			return this.SetGetEntry(form, entryId, setFieldValueList, null);
		}
		public FieldValueList SetGetEntry(string form, string entryId, FieldValueList setFieldValueList, FieldIdList fieldIdList)
		{
			return this.SetGetEntry(form, entryId, setFieldValueList, Util.ConvertToUInt32Array(fieldIdList));
		}
		public FieldValueList SetGetEntry(string form, string entryId, FieldValueList setFieldValueList, uint[] fieldIdList)
		{
			object obj = Util.StringToEntryId(entryId);
			ARTypeMgr arg_37_0 = ARTypeMgr.Instance;
			string arg_37_1 = "BMC.ARSystem.FieldValueList";
			string arg_37_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj2 = arg_37_0.BuildVariantFromCustomDictionary(arg_37_1, arg_37_2, keyIndex, "ARValue", new int[]
			{
				1
			}, setFieldValueList);
			object obj3 = ARTypeMgr.Instance.toVariant(fieldIdList);
			object[] v = new object[]
			{
				"ARSetGetEntry",
				this._control,
				form,
				obj,
				obj2,
				obj3
			};
			object[] array = (object[])this._Eval(v);
			ARTypeMgr arg_C9_0 = ARTypeMgr.Instance;
			Type arg_C9_1 = typeof(FieldValueList);
			string arg_C9_2 = "System.UInt32";
			keyIndex = new int[1];
			IDictionary dictionary = arg_C9_0.BuildCustomDictionaryFromVariant(arg_C9_1, arg_C9_2, keyIndex, "ARValue", new int[]
			{
				1
			}, (object[])array[10], this);
			return (FieldValueList)dictionary;
		}
		public void SetEntryByQuery(string formName, string qualification, bool useLocale, Server.SetEntryByQuery_NoMatchOption noMatchOption, Server.SetEntryByQuery_MultiMatchOption multiMatchOption, FieldValueList fieldValueList)
		{
			EntryListFieldList entryListFieldList = new EntryListFieldList();
			entryListFieldList.AddField(1, 128, " ");
			EntryListFieldList arg_29_3 = entryListFieldList;
			uint arg_29_4 = 0u;
			uint arg_29_5 = 999999999u;
			int num = 0;
			ArrayList listEntry = this.GetListEntry(formName, qualification, arg_29_3, arg_29_4, arg_29_5, out num, null, null, useLocale);
			if (listEntry == null || listEntry.get_Count() == 0)
			{
				switch (noMatchOption)
				{
				case Server.SetEntryByQuery_NoMatchOption.Error:
					throw new ARException("No matching entries to push the field values to");
				case (Server.SetEntryByQuery_NoMatchOption)2:
					break;
				case Server.SetEntryByQuery_NoMatchOption.NoAction:
					return;
				case Server.SetEntryByQuery_NoMatchOption.SubmitEntry:
					this.CreateEntry(formName, fieldValueList);
					return;
				default:
					return;
				}
			}
			else
			{
				if (listEntry != null && listEntry.get_Count() > 1)
				{
					switch (multiMatchOption)
					{
					case Server.SetEntryByQuery_MultiMatchOption.Error:
						throw new ARException("Multiple matching entries to push the field values to");
					case (Server.SetEntryByQuery_MultiMatchOption)2:
						return;
					case Server.SetEntryByQuery_MultiMatchOption.ModifyFirst:
						break;
					case Server.SetEntryByQuery_MultiMatchOption.PickList:
					{
						string text = null;
						if (this.SetEntryByQuery_PickEntryFromListEvent != null)
						{
							Server.SetEntryByQuery_PickEntryFromListArgs setEntryByQuery_PickEntryFromListArgs = new Server.SetEntryByQuery_PickEntryFromListArgs(listEntry);
							this.SetEntryByQuery_PickEntryFromListEvent(setEntryByQuery_PickEntryFromListArgs);
							text = setEntryByQuery_PickEntryFromListArgs.SelectedEntyForPush;
						}
						if (text != null && text.get_Length() > 0)
						{
							this.SetEntry(formName, text, fieldValueList);
							return;
						}
						return;
					}
					case Server.SetEntryByQuery_MultiMatchOption.ModifyAll:
					{
						IEnumerator enumerator = listEntry.GetEnumerator();
						try
						{
							while (enumerator.MoveNext())
							{
								EntryDescription entryDescription = (EntryDescription)enumerator.get_Current();
								this.SetEntry(formName, entryDescription.EntryId, fieldValueList);
							}
							return;
						}
						finally
						{
							IDisposable disposable = enumerator as IDisposable;
							if (disposable != null)
							{
								disposable.Dispose();
							}
						}
						break;
					}
					case Server.SetEntryByQuery_MultiMatchOption.NoAction:
						return;
					default:
						return;
					}
					this.SetEntry(formName, ((EntryDescription)listEntry.get_Item(0)).EntryId, fieldValueList);
					return;
				}
				this.SetEntry(formName, ((EntryDescription)listEntry.get_Item(0)).EntryId, fieldValueList);
			}
		}
		public void GetEntryBLOB(string form, string entryId, uint fieldId, string filePath)
		{
			string[] given = entryId.Split(new char[]
			{
				'|'
			});
			object obj = ARTypeMgr.Instance.toVariant(given);
			object obj2 = ARTypeMgr.Instance.toVariant(Convert.ToInt32(fieldId));
			object obj3 = new object[]
			{
				1,
				filePath
			};
			object[] v = new object[]
			{
				"ARGetEntryBLOB",
				this._control,
				form,
				obj,
				obj2,
				obj3
			};
			object[] arg_98_0 = (object[])this._Eval(v);
		}
		public void GetEntryBLOB(string form, string entryId, uint fieldId, out byte[] content)
		{
			string[] given = entryId.Split(new char[]
			{
				'|'
			});
			object obj = ARTypeMgr.Instance.toVariant(given);
			object obj2 = ARTypeMgr.Instance.toVariant(fieldId);
			object obj3 = new object[]
			{
				2
			};
			object[] v = new object[]
			{
				"ARGetEntryBLOB",
				this._control,
				form,
				obj,
				obj2,
				obj3
			};
			object[] rawData = (object[])this._Eval(v);
			content = (byte[])Util.GetAt(rawData, new int[]
			{
				6,
				1,
				1
			});
		}
		public ArrayList GetEntryStatistics(string formName, string qualification, string expression, uint statCode, string groupBy)
		{
			return this.GetEntryStatistics(formName, null, qualification, expression, statCode, groupBy);
		}
		public ArrayList GetEntryStatistics(string formName, string qualification, string expression, uint statCode, int[] groupBy)
		{
			return this.GetEntryStatistics(formName, null, qualification, expression, statCode, groupBy);
		}
		public ArrayList GetEntryStatistics(string formName, string vuiName, string qualification, string expression, uint statCode, string groupBy)
		{
			return this.GetEntryStatistics(formName, vuiName, qualification, expression, statCode, Util.SplitIntoIntArray(groupBy));
		}
		public ArrayList GetEntryStatistics(string formName, string vuiName, string qualification, string expression, uint statCode, int[] groupBy)
		{
			object obj = this.ParseQualification(formName, vuiName, qualification);
			object obj2 = null;
			if (expression != null && expression.get_Length() > 0)
			{
				string qualification2 = string.Format("({0}) = $NULL$", expression);
				obj2 = this.ParseQualification(formName, qualification2);
				obj2 = Util.GetAt(obj2, new int[]
				{
					1,
					1
				});
			}
			object obj3 = ARTypeMgr.Instance.toVariant(groupBy);
			object[] v = new object[]
			{
				"ARGetEntryStatistics",
				this._control,
				formName,
				obj,
				obj2,
				statCode,
				obj3
			};
			object[] array = (object[])this._Eval(v);
			return Util.BuildEntryStatResponse(array[8]);
		}
		public object LoadQualifier(string formName, string vuiName, string qualification)
		{
			object[] v = new object[]
			{
				"ARLoadARQualifierStruct",
				this._control,
				formName,
				vuiName,
				qualification
			};
			return (object[])this._Eval(v);
		}
		public ArrayList GetListEntry(string formName, string qualification)
		{
			return this.GetListEntry(formName, qualification, null);
		}
		public ArrayList GetListEntry(string formName, string qualification, EntryListFieldList fieldIdList)
		{
			return this.GetListEntry(formName, qualification, fieldIdList, 0u, 999999999u);
		}
		public ArrayList GetListEntry(string formName, string qualification, FieldIdList fieldIdList)
		{
			EntryListFieldList fieldIdList2 = Util.ConvertToEntryListFieldList(fieldIdList);
			return this.GetListEntry(formName, qualification, fieldIdList2);
		}
		public ArrayList GetListEntry(string formName, string qualification, uint firstRetrieve, uint maxRetrieve)
		{
			return this.GetListEntry(formName, qualification, null, firstRetrieve, maxRetrieve);
		}
		public ArrayList GetListEntry(string formName, string qualification, EntryListFieldList fieldIdList, uint firstRetrieve, uint maxRetrieve)
		{
			int num;
			return this.GetListEntry(formName, qualification, fieldIdList, firstRetrieve, maxRetrieve, out num);
		}
		public ArrayList GetListEntry(string formName, string qualification, EntryListFieldList fieldIdList, uint firstRetrieve, uint maxRetrieve, out int numMatches)
		{
			return this.GetListEntry(formName, qualification, fieldIdList, firstRetrieve, maxRetrieve, out numMatches, null);
		}
		public ArrayList GetListEntry(string formName, string qualification, EntryListFieldList fieldIdList, uint firstRetrieve, uint maxRetrieve, ArrayList sortInfoList)
		{
			int num;
			return this.GetListEntry(formName, qualification, fieldIdList, firstRetrieve, maxRetrieve, out num, sortInfoList);
		}
		public ArrayList GetListEntry(string formName, string qualification, EntryListFieldList fieldIdList, uint firstRetrieve, uint maxRetrieve, out int numMatches, ArrayList sortInfoList)
		{
			return this.GetListEntry(formName, qualification, fieldIdList, firstRetrieve, maxRetrieve, out numMatches, sortInfoList, null, false);
		}
		public ArrayList GetListEntry(string formName, string qualification, EntryListFieldList fieldIdList, uint firstRetrieve, uint maxRetrieve, out int numMatches, ArrayList sortInfoList, string vuiName, bool useLocale)
		{
			object obj = this.ParseQualification(formName, vuiName, qualification);
			object obj2 = ARTypeMgr.Instance.toVariant(fieldIdList);
			object obj3 = ARTypeMgr.Instance.toVariant(sortInfoList);
			object[] v = new object[]
			{
				"ARGetListEntry",
				this._control,
				formName,
				obj,
				obj2,
				obj3,
				firstRetrieve,
				maxRetrieve,
				useLocale
			};
			object[] array = (object[])this._Eval(v);
			numMatches = Convert.ToInt32(array[11]);
			return Util.BuildGLEResponse(array[10], formName);
		}
		public EntryFieldValueList GetListEntryWithFields(string formName, string qualification, EntryListFieldList fieldIdList, uint firstRetrieve, uint maxRetrieve)
		{
			int num;
			return this.GetListEntryWithFields(formName, qualification, fieldIdList, firstRetrieve, maxRetrieve, out num);
		}
		public EntryFieldValueList GetListEntryWithFields(string formName, string qualification, EntryListFieldList fieldIdList, uint firstRetrieve, uint maxRetrieve, out int numMatches)
		{
			return this.GetListEntryWithFields(formName, qualification, fieldIdList, firstRetrieve, maxRetrieve, out numMatches, null, null, false);
		}
		public EntryFieldValueList GetListEntryWithFields(string formName, string qualification, EntryListFieldList fieldIdList, uint firstRetrieve, uint maxRetrieve, out int numMatches, ArrayList sortInfoList, string vuiName, bool useLocale)
		{
			object obj = this.ParseQualification(formName, vuiName, qualification);
			object obj2 = ARTypeMgr.Instance.toVariant(fieldIdList);
			object obj3 = ARTypeMgr.Instance.toVariant(sortInfoList);
			object[] v = new object[]
			{
				"ARGetListEntryWithFields",
				this._control,
				formName,
				obj,
				obj2,
				obj3,
				firstRetrieve,
				maxRetrieve,
				useLocale
			};
			object[] array = (object[])this._Eval(v);
			numMatches = Convert.ToInt32(array[11]);
			return Util.BuildGLEWFResponse(array[10]);
		}
		public EntryFieldValueList GetListEntryWithFields(string formName, string qualification, int[] fieldIdList, uint firstRetrieve, uint maxRetrieve)
		{
			int num;
			return this.GetListEntryWithFields(formName, qualification, fieldIdList, firstRetrieve, maxRetrieve, out num);
		}
		public EntryFieldValueList GetListEntryWithFields(string formName, string qualification, int[] fieldIdList, uint firstRetrieve, uint maxRetrieve, out int numMatches)
		{
			return this.GetListEntryWithFields(formName, qualification, fieldIdList, firstRetrieve, maxRetrieve, out numMatches, null, null, false);
		}
		public EntryFieldValueList GetListEntryWithFields(string formName, string qualification, int[] fieldIdList, uint firstRetrieve, uint maxRetrieve, out int numMatches, ArrayList sortInfoList, string vuiName, bool useLocale)
		{
			object obj = this.ParseQualification(formName, vuiName, qualification);
			object obj2 = ARTypeMgr.Instance.toVariant(ARTypeMgr.Instance.ObjectFromVariant(typeof(EntryListFieldList), ARTypeMgr.Instance.toVariant(fieldIdList), this));
			object obj3 = ARTypeMgr.Instance.toVariant(sortInfoList);
			object[] v = new object[]
			{
				"ARGetListEntryWithFields",
				this._control,
				formName,
				obj,
				obj2,
				obj3,
				firstRetrieve,
				maxRetrieve,
				useLocale
			};
			object[] array = (object[])this._Eval(v);
			numMatches = Convert.ToInt32(array[11]);
			return Util.BuildGLEWFResponse(array[10]);
		}
		public DataTable GetListEntryWithFields(string formName, string qualification, int[] fieldIdList, uint firstRetrieve, uint maxRetrieve, out int numMatches, ArrayList sortInfoList, string vuiName, bool useLocale, string[] colNames, Type[] colTypes)
		{
			object obj = this.ParseQualification(formName, vuiName, qualification);
			object obj2 = ARTypeMgr.Instance.toVariant(ARTypeMgr.Instance.ObjectFromVariant(typeof(EntryListFieldList), ARTypeMgr.Instance.toVariant(fieldIdList), this));
			object obj3 = ARTypeMgr.Instance.toVariant(sortInfoList);
			object[] v = new object[]
			{
				"ARGetListEntryWithFields",
				this._control,
				formName,
				obj,
				obj2,
				obj3,
				firstRetrieve,
				maxRetrieve,
				useLocale
			};
			object[] array = (object[])this._Eval(v);
			numMatches = Convert.ToInt32(array[11]);
			return Util.BuildGLEWFResponseDataTable(array[10], formName, colNames, colTypes);
		}
		public string MergeEntry(string form, FieldValueList fieldValueList, Server.MergeDuplicateOption mergeDuplicateOption, bool skipRequiredCheck, bool skipPatternCheck, bool suppressFilters)
		{
			ARTypeMgr arg_30_0 = ARTypeMgr.Instance;
			string arg_30_1 = "BMC.ARSystem.FieldValueList";
			string arg_30_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj = arg_30_0.BuildVariantFromCustomDictionary(arg_30_1, arg_30_2, keyIndex, "ARValue", new int[]
			{
				1
			}, fieldValueList);
			object[] v = new object[]
			{
				"ARMergeEntry",
				this._control,
				form,
				obj,
				(int)(mergeDuplicateOption | (skipRequiredCheck ? ((Server.MergeDuplicateOption)1024) : ((Server.MergeDuplicateOption)0)) | (skipPatternCheck ? ((Server.MergeDuplicateOption)2048) : ((Server.MergeDuplicateOption)0)) | (suppressFilters ? ((Server.MergeDuplicateOption)4096) : ((Server.MergeDuplicateOption)0)))
			};
			object[] array = (object[])this._Eval(v);
			return (string)array[8];
		}
		public string MergeEntry(string form, FieldValueList fieldValueList, Server.MergeDuplicateOption mergeDuplicateOption, bool skipRequiredCheck, bool skipPatternCheck, bool suppressFilters, string qualification, uint multiMatchOption)
		{
			ARTypeMgr arg_30_0 = ARTypeMgr.Instance;
			string arg_30_1 = "BMC.ARSystem.FieldValueList";
			string arg_30_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj = arg_30_0.BuildVariantFromCustomDictionary(arg_30_1, arg_30_2, keyIndex, "ARValue", new int[]
			{
				1
			}, fieldValueList);
			object obj2 = this.ParseQualification(form, qualification);
			object[] v = new object[]
			{
				"ARMergeEntry",
				this._control,
				form,
				obj,
				(int)(mergeDuplicateOption | (skipRequiredCheck ? ((Server.MergeDuplicateOption)1024) : ((Server.MergeDuplicateOption)0)) | (skipPatternCheck ? ((Server.MergeDuplicateOption)2048) : ((Server.MergeDuplicateOption)0)) | (suppressFilters ? ((Server.MergeDuplicateOption)4096) : ((Server.MergeDuplicateOption)0))),
				obj2,
				multiMatchOption
			};
			object[] array = (object[])this._Eval(v);
			return (string)array[8];
		}
		[ComVisible(false)]
		public ArrayList GetMultipleEntries(string form, ArrayList entryIds, uint[] fieldIdList)
		{
			ArrayList arrayList = new ArrayList(entryIds.get_Count());
			IEnumerator enumerator = entryIds.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					string entryId = (string)enumerator.get_Current();
					arrayList.Add(Util.StringToEntryId(entryId));
				}
			}
			finally
			{
				IDisposable disposable = enumerator as IDisposable;
				if (disposable != null)
				{
					disposable.Dispose();
				}
			}
			object obj = ARTypeMgr.Instance.toVariant(arrayList);
			object obj2 = ARTypeMgr.Instance.toVariant(fieldIdList);
			object[] v = new object[]
			{
				"ARGetMultipleEntries",
				this._control,
				form,
				obj,
				obj2
			};
			object[] array = (object[])this._Eval(v);
			ArrayList arrayList2 = new ArrayList();
			object[] array2 = (object[])array[7];
			if (array2 != null)
			{
				int i = 0;
				int num = array2.Length;
				while (i < num)
				{
					object[] array3 = array2[i] as object[];
					if (array3 != null)
					{
						ARTypeMgr arg_112_0 = ARTypeMgr.Instance;
						Type arg_112_1 = typeof(FieldValueList);
						string arg_112_2 = "System.UInt32";
						int[] keyIndex = new int[1];
						IDictionary dictionary = arg_112_0.BuildCustomDictionaryFromVariant(arg_112_1, arg_112_2, keyIndex, "ARValue", new int[]
						{
							1
						}, array3, this);
						arrayList2.Add(new EntryFieldValue(entryIds.get_Item(i).ToString(), (FieldValueList)dictionary));
					}
					i++;
				}
			}
			return arrayList2;
		}
		[ComVisible(false)]
		public ArrayList GetMultipleEntries(string form, ArrayList entryIds, FieldIdList fieldIdList)
		{
			return this.GetMultipleEntries(form, entryIds, Util.ConvertToUInt32Array(fieldIdList));
		}
		public void CreateOverlay(Overlaid objOverlaid, string modLogLbl, ref string overlayObjName, ref uint overlayId)
		{
			object obj = ARTypeMgr.Instance.toVariant(objOverlaid);
			object obj2 = overlayObjName;
			object obj3 = ARTypeMgr.Instance.toVariant(overlayId);
			object[] v = new object[]
			{
				"ARCreateOverlay",
				this._control,
				obj,
				modLogLbl,
				obj2,
				obj3
			};
			object[] array = (object[])this._Eval(v);
			overlayObjName = (string)array[5];
			overlayId = (uint)array[6];
		}
		public void CreateOverlayFromObject(Overlaid objOverlaid, Overlaid objCustom, string modLogLbl, ref string overlayObjName, ref uint overlayId)
		{
			object obj = ARTypeMgr.Instance.toVariant(objOverlaid);
			object obj2 = ARTypeMgr.Instance.toVariant(objCustom);
			object obj3 = overlayObjName;
			object obj4 = ARTypeMgr.Instance.toVariant(overlayId);
			object[] v = new object[]
			{
				"ARCreateOverlayFromObject",
				this._control,
				obj,
				obj2,
				modLogLbl,
				obj3,
				obj4
			};
			object[] array = (object[])this._Eval(v);
			overlayObjName = (string)array[6];
			overlayId = (uint)array[7];
		}
		internal static void LoadFieldList(StringReader sr, out ArrayList fieldIDs, out ArrayList dataTypes)
		{
			string text = sr.ReadLine();
			fieldIDs = new ArrayList();
			Regex regex = new Regex("^(FLD-ID[^0-9]*)([0-9]+)(.*)$");
			while (regex.IsMatch(text))
			{
				string text2 = regex.Replace(text, "$2");
				fieldIDs.Add(Convert.ToUInt32(text2));
				text = regex.Replace(text, "$1$3");
			}
			dataTypes = new ArrayList();
			text = sr.ReadLine();
			regex = new Regex("^(DTYPES[^A-Z]*)([A-Z]+)(.*)$");
			while (regex.IsMatch(text))
			{
				string text3 = regex.Replace(text, "$2");
				dataTypes.Add(text3);
				text = regex.Replace(text, "$1$3");
			}
			if (fieldIDs.get_Count() != dataTypes.get_Count())
			{
				throw new Exception("The number of field IDs in the file dos not match the number of datatypes.");
			}
		}
		internal static IDictionary LoadARX(Stream stream)
		{
			IDictionary dictionary = new Hashtable();
			StreamReader streamReader = new StreamReader(stream);
			string text = streamReader.ReadToEnd();
			Regex regex = new Regex("^SCHEMA \"(.*)\"", 2);
			MatchCollection matchCollection = regex.Matches(text);
			int i = 1;
			int count = matchCollection.get_Count();
			while (i <= count)
			{
				Match match = matchCollection.get_Item(i - 1);
				Match match2 = (i == count) ? null : match.NextMatch();
				string text2 = regex.Replace(match.get_Value(), "$1");
				int index = match.get_Index();
				string text3;
				if (i != count)
				{
					text3 = text.Substring(index, match2.get_Index() - index);
				}
				else
				{
					text3 = text.Substring(index);
				}
				dictionary.set_Item(text2, new object[]
				{
					(long)index,
					(long)text3.get_Length(),
					new StringReader(text3)
				});
				i++;
			}
			return dictionary;
		}
		internal void ImportEntries(Stream stream, long baseOffset, long totalDataSize, StringReader sr, string targetForm, uint[,] fieldMapping, uint duplicateMatchFieldId, Server.MergeDuplicateOption mergeDuplicateOption, bool skipRequiredCheck, bool skipPatternCheck, bool suppressFilters, bool applyDefaultsForNulls)
		{
			IDictionary fieldDefs = null;
			if (applyDefaultsForNulls)
			{
				fieldDefs = this.GetAllFields(targetForm);
			}
			if (this.ARXImportBeginEvent != null)
			{
				Server.ARXImportBeginArgs aRXImportBeginArgs = new Server.ARXImportBeginArgs();
				aRXImportBeginArgs.FileName = "Not available, importing from a <stream>";
				aRXImportBeginArgs.DataSize = totalDataSize;
				aRXImportBeginArgs.FormName = targetForm;
				this.ARXImportBeginEvent(aRXImportBeginArgs);
			}
			long num = baseOffset + (long)sr.ReadLine().get_Length();
			num += (long)sr.ReadLine().get_Length();
			ArrayList fieldIDs;
			ArrayList dataTypes;
			Server.LoadFieldList(sr, out fieldIDs, out dataTypes);
			uint num2 = 1u;
			uint numNewRowsCreated = 0u;
			uint numRowsImported = 0u;
			uint numRowsFailed = 0u;
			uint numRowsSkipped = 0u;
			string text;
			while ((text = sr.ReadLine()) != null)
			{
				this.ImportEntry(text, fieldIDs, dataTypes, targetForm, fieldMapping, applyDefaultsForNulls, fieldDefs, duplicateMatchFieldId, mergeDuplicateOption, skipRequiredCheck, skipPatternCheck, suppressFilters, num, ref num2, ref numNewRowsCreated, ref numRowsImported, ref numRowsFailed, ref numRowsSkipped);
				num += (long)text.get_Length();
			}
			if (this.ARXImportEndEvent != null)
			{
				Server.ARXImportEndArgs e = new Server.ARXImportEndArgs("Not available, importing from a <stream>", num, numRowsImported, numNewRowsCreated, numRowsFailed, numRowsSkipped);
				this.ARXImportEndEvent(e);
			}
		}
		internal static FieldValueList ApplyFieldMapping(FieldValueList fieldValueList, uint[,] fieldIdMapping)
		{
			FieldValueList fieldValueList2 = new FieldValueList();
			int i = fieldIdMapping.GetLowerBound(0);
			int upperBound = fieldIdMapping.GetUpperBound(0);
			while (i <= upperBound)
			{
				object obj = fieldValueList[Convert.ToUInt32(fieldIdMapping[i, 0])];
				if (obj != null)
				{
					fieldValueList2[Convert.ToUInt32(fieldIdMapping[i, 1])] = obj;
				}
				i++;
			}
			return fieldValueList2;
		}
		internal Attachment LoadAttachmentValue(uint recordNum, uint fieldId, string filePath)
		{
			Stream stream = null;
			if (this.ARXImportLoadAttachmentValueEvent != null)
			{
				Server.ARXImportLoadAttachmentValueEventArgs aRXImportLoadAttachmentValueEventArgs = new Server.ARXImportLoadAttachmentValueEventArgs(recordNum, fieldId, filePath);
				this.ARXImportLoadAttachmentValueEvent(aRXImportLoadAttachmentValueEventArgs);
				stream = aRXImportLoadAttachmentValueEventArgs.LoadValueFrom;
			}
			if (stream == null)
			{
				stream = File.OpenRead(filePath);
			}
			Attachment attachment = new Attachment();
			byte[] array = new byte[stream.get_Length()];
			stream.Read(array, 0, (int)stream.get_Length());
			attachment.SetValue(filePath, array);
			return attachment;
		}
		private string buildQualForAlternateMatching(uint duplicateMatchFieldId, object val)
		{
			object obj;
			if (val is string)
			{
				obj = Util.QuoteStringForCSV((string)val);
			}
			else
			{
				if (val is DateTime)
				{
					obj = Util.GetARTimestamp((DateTime)val);
				}
				else
				{
					if (val is CurrencyValue)
					{
						obj = Util.QuoteStringForCSV(val.ToString());
					}
					else
					{
						if (val is decimal)
						{
							obj = Util.QuoteStringForCSV(val.ToString());
						}
						else
						{
							obj = val;
						}
					}
				}
			}
			return string.Format("'{0}' = {1}", duplicateMatchFieldId, obj);
		}
		private void ImportEntry(string line, ArrayList fieldIDs, ArrayList dataTypes, string targetForm, uint[,] fieldMapping, bool applyDefaultsForNulls, IDictionary fieldDefs, uint duplicateMatchFieldId, Server.MergeDuplicateOption mergeDuplicateOption, bool skipRequiredCheck, bool skipPatternCheck, bool suppressFilters, long position, ref uint recordNum, ref uint recordsCreated, ref uint recordsImported, ref uint recordsFailed, ref uint recordsSkipped)
		{
			int length = line.get_Length();
			Regex regex = new Regex("^(DATA)[ ]+\"((?:(?:\\\\.)|(?:[^\"]))*)\"(.*)$");
			Regex regex2 = new Regex("^(DATA)[ ]+([^ ]*)(.*)$");
			if (!regex.IsMatch(line) && !regex2.IsMatch(line))
			{
				throw new Exception("DATA line in ARX file does not match expected format");
			}
			FieldValueList fieldValueList = new FieldValueList();
			int num = 0;
			while (num < fieldIDs.get_Count() && (regex.IsMatch(line) || regex2.IsMatch(line)))
			{
				uint num2 = Convert.ToUInt32(fieldIDs.get_Item(num));
				ARXDataTypeReader aRXDataTypeReader = ARXDataTypeReader.CreateReader((string)dataTypes.get_Item(num));
				string text = "";
				if (!regex.IsMatch(line))
				{
					if (regex2.IsMatch(line))
					{
						text = regex2.Replace(line, "$2");
						line = regex2.Replace(line, "$1$3");
						if ((uint)fieldIDs.get_Item(num) != 102)
						{
							goto IL_100;
						}
						try
						{
							text = this.FirstOperationTime(text);
							goto IL_100;
						}
						catch (Exception ex)
						{
							throw new ARException("Decryption of password from ARX data failed (may be in older format and not supported by the AR System .NET API); exception trace : " + ex.get_StackTrace());
						}
					}
					throw new Exception("DATA value in ARX file does not match expected format");
				}
				text = regex.Replace(line, "$2");
				line = regex.Replace(line, "$1$3");
				IL_100:
				if (text == null || text.get_Length() == 0)
				{
					if (applyDefaultsForNulls)
					{
						Field field = (Field)fieldDefs.get_Item(num2);
						if (field != null && field.DataType != 5u && field.DefaultValue != null && field.DefaultValue != DBNull.Value)
						{
							fieldValueList[num2] = field.DefaultValue;
						}
					}
					else
					{
						fieldValueList[num2] = Keyword.Null;
					}
				}
				else
				{
					if (aRXDataTypeReader is ARXAttachmentReader)
					{
						fieldValueList[num2] = this.LoadAttachmentValue(recordNum, num2, (string)aRXDataTypeReader.ReadValue(text));
					}
					else
					{
						fieldValueList[num2] = aRXDataTypeReader.ReadValue(text);
					}
				}
				num++;
			}
			FieldValueList fieldValueList2 = (fieldMapping != null) ? Server.ApplyFieldMapping(fieldValueList, fieldMapping) : fieldValueList;
			if (duplicateMatchFieldId != 1u)
			{
				string text2 = this.buildQualForAlternateMatching(duplicateMatchFieldId, fieldValueList2[duplicateMatchFieldId]);
				string arg_21D_2 = text2;
				int[] arg_21D_3 = new int[]
				{
					(int)duplicateMatchFieldId
				};
				uint arg_21D_4 = 0u;
				uint arg_21D_5 = 1u;
				int num3 = 0;
				EntryFieldValueList listEntryWithFields = this.GetListEntryWithFields(targetForm, arg_21D_2, arg_21D_3, arg_21D_4, arg_21D_5, out num3, null, null, false);
				if (listEntryWithFields.get_Count() > 0)
				{
					EntryFieldValue entryFieldValue = listEntryWithFields[0];
					string entryId = entryFieldValue.EntryId;
					fieldValueList2[1u] = entryId;
				}
			}
			try
			{
				Server.MergeDuplicateOption mergeDuplicateOption2 = mergeDuplicateOption;
				if (this.ARXImportRecordBeginEvent != null)
				{
					Server.ARXImportRecordBeginArgs aRXImportRecordBeginArgs = new Server.ARXImportRecordBeginArgs(recordNum, position, fieldValueList, mergeDuplicateOption);
					this.ARXImportRecordBeginEvent(aRXImportRecordBeginArgs);
					if (aRXImportRecordBeginArgs.StopImport)
					{
						return;
					}
					if (aRXImportRecordBeginArgs.SkipRecord)
					{
						recordsSkipped += 1u;
						return;
					}
					mergeDuplicateOption2 = aRXImportRecordBeginArgs.MergeDuplicateOption;
				}
				string text3 = this.MergeEntry(targetForm, fieldValueList2, mergeDuplicateOption2, skipRequiredCheck, skipPatternCheck, suppressFilters);
				if (fieldValueList2[1u] != null && fieldValueList2[1u].ToString().CompareTo(text3.ToString()) != 0)
				{
					recordsCreated += 1u;
				}
				recordsImported += 1u;
				if (this.ARXImportRecordEndEvent != null)
				{
					Server.ARXImportRecordEndArgs aRXImportRecordEndArgs = new Server.ARXImportRecordEndArgs(recordNum, position + (long)length, fieldValueList, text3);
					this.ARXImportRecordEndEvent(aRXImportRecordEndArgs);
					if (aRXImportRecordEndArgs.StopImport)
					{
						return;
					}
				}
			}
			catch (Exception failureReason)
			{
				recordsFailed += 1u;
				Server.ARXImportRecordFailedArgs aRXImportRecordFailedArgs = new Server.ARXImportRecordFailedArgs();
				aRXImportRecordFailedArgs.RecordNumber = recordNum;
				aRXImportRecordFailedArgs.FailureReason = failureReason;
				aRXImportRecordFailedArgs.FieldValues = fieldValueList;
				if (this.ARXImportRecordFailedEvent != null)
				{
					this.ARXImportRecordFailedEvent(aRXImportRecordFailedArgs);
				}
			}
			recordNum += 1u;
		}
		public void ImportARXData(string filePath, Server.MergeDuplicateOption mergeDuplicateOption, bool skipRequiredCheck, bool skipPatternCheck, bool suppressFilters, bool applyDefaultsForNulls)
		{
			this.ImportARXData(filePath, null, null, null, 1u, mergeDuplicateOption, skipRequiredCheck, skipPatternCheck, suppressFilters, applyDefaultsForNulls);
		}
		public void ImportARXData(string filePath, string form, Server.MergeDuplicateOption mergeDuplicateOption, bool skipRequiredCheck, bool skipPatternCheck, bool suppressFilters, bool applyDefaultsForNulls)
		{
			this.ImportARXData(filePath, null, form, null, 1u, mergeDuplicateOption, skipRequiredCheck, skipPatternCheck, suppressFilters, applyDefaultsForNulls);
		}
		public void ImportARXData(string filePath, string fileForm, string targetForm, uint[,] fieldIdMapping, uint duplicateMatchFieldId, Server.MergeDuplicateOption mergeDuplicateOption, bool skipRequiredCheck, bool skipPatternCheck, bool suppressFilters, bool applyDefaultsForNulls)
		{
			string currentDirectory = Directory.GetCurrentDirectory();
			try
			{
				string directoryName = Path.GetDirectoryName(filePath);
				string fileName = Path.GetFileName(filePath);
				Directory.SetCurrentDirectory(directoryName);
				this.ImportARXData(File.OpenRead(fileName), fileForm, targetForm, fieldIdMapping, duplicateMatchFieldId, mergeDuplicateOption, skipRequiredCheck, skipPatternCheck, suppressFilters, applyDefaultsForNulls);
			}
			finally
			{
				Directory.SetCurrentDirectory(currentDirectory);
			}
		}
		public void ImportARXData(Stream stream, Server.MergeDuplicateOption mergeDuplicateOption, bool skipRequiredCheck, bool skipPatternCheck, bool suppressFilters, bool applyDefaultsForNulls)
		{
			this.ImportARXData(stream, null, null, null, 1u, mergeDuplicateOption, skipRequiredCheck, skipPatternCheck, suppressFilters, applyDefaultsForNulls);
		}
		public void ImportARXData(Stream stream, string form, Server.MergeDuplicateOption mergeDuplicateOption, bool skipRequiredCheck, bool skipPatternCheck, bool suppressFilters, bool applyDefaultsForNulls)
		{
			this.ImportARXData(stream, null, form, null, 1u, mergeDuplicateOption, skipRequiredCheck, skipPatternCheck, suppressFilters, applyDefaultsForNulls);
		}
		public void ImportARXData(Stream stream, string fileForm, string targetForm, uint[,] fieldIdMapping, uint duplicateMatchFieldId, Server.MergeDuplicateOption mergeDuplicateOption, bool skipRequiredCheck, bool skipPatternCheck, bool suppressFilters, bool applyDefaultsForNulls)
		{
			IDictionary dictionary = Server.LoadARX(stream);
			try
			{
				if (targetForm == null)
				{
					fieldIdMapping = null;
					if (fileForm == null)
					{
						IEnumerator enumerator = dictionary.get_Keys().GetEnumerator();
						try
						{
							while (enumerator.MoveNext())
							{
								string text = (string)enumerator.get_Current();
								fileForm = text;
								targetForm = fileForm;
								this.ImportEntries(stream, (long)((object[])dictionary.get_Item(fileForm))[0], (long)((object[])dictionary.get_Item(fileForm))[1], (StringReader)((object[])dictionary.get_Item(fileForm))[2], targetForm, fieldIdMapping, duplicateMatchFieldId, mergeDuplicateOption, skipRequiredCheck, skipPatternCheck, suppressFilters, applyDefaultsForNulls);
							}
							goto IL_1DC;
						}
						finally
						{
							IDisposable disposable = enumerator as IDisposable;
							if (disposable != null)
							{
								disposable.Dispose();
							}
						}
					}
					targetForm = fileForm;
					if (!dictionary.Contains(fileForm))
					{
						throw new Exception(string.Format("Data for form '{0}' does not exist in the given stream.", fileForm));
					}
					this.ImportEntries(stream, (long)((object[])dictionary.get_Item(fileForm))[0], (long)((object[])dictionary.get_Item(fileForm))[1], (StringReader)((object[])dictionary.get_Item(fileForm))[2], targetForm, fieldIdMapping, duplicateMatchFieldId, mergeDuplicateOption, skipRequiredCheck, skipPatternCheck, suppressFilters, applyDefaultsForNulls);
				}
				else
				{
					if (fileForm == null)
					{
						if (dictionary.get_Count() == 1)
						{
							IEnumerator enumerator = dictionary.get_Keys().GetEnumerator();
							try
							{
								if (enumerator.MoveNext())
								{
									string text2 = (string)enumerator.get_Current();
									fileForm = text2;
								}
								goto IL_16F;
							}
							finally
							{
								IDisposable disposable = enumerator as IDisposable;
								if (disposable != null)
								{
									disposable.Dispose();
								}
							}
						}
						fileForm = targetForm;
					}
					IL_16F:
					if (!dictionary.Contains(fileForm))
					{
						throw new Exception(string.Format("Data for form '{0}' does not exist in the given stream.", fileForm));
					}
					this.ImportEntries(stream, (long)((object[])dictionary.get_Item(fileForm))[0], (long)((object[])dictionary.get_Item(fileForm))[1], (StringReader)((object[])dictionary.get_Item(fileForm))[2], targetForm, fieldIdMapping, duplicateMatchFieldId, mergeDuplicateOption, skipRequiredCheck, skipPatternCheck, suppressFilters, applyDefaultsForNulls);
				}
				IL_1DC:;
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void ExportData(string filePath, string formName)
		{
			this.ExportData(filePath, formName, "1=1");
		}
		public void ExportData(string filePath, string formName, string qualification)
		{
			this.ExportData(filePath, formName, qualification, false);
		}
		public void ExportData(string filePath, string formName, string qualification, bool isAppendMode)
		{
			this.ExportData(filePath, formName, qualification, isAppendMode, Server.DataExportFormat.ARX);
		}
		public void ExportData(string filePath, string formName, string qualification, bool isAppendMode, Server.DataExportFormat format)
		{
			this.ExportData(filePath, formName, qualification, isAppendMode, format, Encoding.get_Default());
		}
		public void ExportData(string filePath, string formName, string qualification, bool isAppendMode, Server.DataExportFormat format, Encoding encoding)
		{
			DataExporter exporter;
			if (format == Server.DataExportFormat.ARX)
			{
				exporter = new ARXDataExporter();
			}
			else
			{
				if (format == Server.DataExportFormat.CSV)
				{
					exporter = new CSVDataExporter();
				}
				else
				{
					if (format != Server.DataExportFormat.XML)
					{
						throw new Exception(string.Format("Data export format ({0})is not supported.", format));
					}
					exporter = new XMLDataExporter();
				}
			}
			this.ExportData(filePath, formName, qualification, isAppendMode, encoding, exporter);
		}
		public void ExportData(string filePath, string formName, string qualification, bool isAppendMode, Encoding encoding, DataExporter exporter)
		{
			exporter.ExportData(filePath, formName, qualification, isAppendMode, encoding, null, false, this);
		}
		public ProcessResult ExecuteProcess(string command)
		{
			object[] v = new object[]
			{
				"ARExecuteProcess",
				this._control,
				command
			};
			object[] array = (object[])this._Eval(v);
			return new ProcessResult((int)array[4], (string)array[5]);
		}
		public ActiveLinkProcessResult ExecuteProcessForActiveLink(string activeLinkName, uint actionIndex, Server.ExecuteProcessActionType actionType, int fieldIndex, DateTime timeStamp, FieldValueList keywordValues, FieldValueList parameterValues)
		{
			object obj = Util.GetARTimestamp(timeStamp);
			object obj2 = ARTypeMgr.Instance.toVariant(keywordValues);
			object obj3 = ARTypeMgr.Instance.toVariant(parameterValues);
			object[] v = new object[]
			{
				"ARExecuteProcessForActiveLink",
				this._control,
				activeLinkName,
				actionIndex,
				(int)actionType,
				fieldIndex,
				obj,
				obj2,
				obj3
			};
			object[] array = (object[])this._Eval(v);
			return new ActiveLinkProcessResult((int)array[10], (string)array[11], (string)array[12]);
		}
		public object DecodeAssignment(string encoded)
		{
			object[] v = new object[]
			{
				"ARDecodeARAssignStruct",
				this._control,
				encoded
			};
			object[] array = (object[])this._Eval(v);
			return array[4];
		}
		public object DecodeQualifier(string encodedQualText)
		{
			object[] v = new object[]
			{
				"ARDecodeARQualifierStruct",
				this._control,
				encodedQualText
			};
			object[] array = (object[])this._Eval(v);
			return array[4];
		}
		public string EncodeQualifier(object qualifier)
		{
			object[] v = new object[]
			{
				"AREncodeARQualifierStruct",
				this._control,
				qualifier
			};
			object[] array = (object[])this._Eval(v);
			return (string)array[4];
		}
		public string EncodeAssignment(object assignment)
		{
			object[] v = new object[]
			{
				"AREncodeARAssignStruct",
				this._control,
				assignment
			};
			object[] array = (object[])this._Eval(v);
			return (string)array[4];
		}
		public string GenerateGUID()
		{
			ProcessResult processResult = this.ExecuteSpecialCommand("Application-Generate-GUID", new object[0]);
			return processResult.ReturnString;
		}
		public bool IsMemberOfGroup(uint groupId)
		{
			ProcessResult processResult = this.ExecuteSpecialCommand("Application-Confirm-Group", new object[]
			{
				groupId
			});
			return processResult.ReturnCode == 0 && processResult.ReturnString.Equals("1");
		}
		public object ParseAssignment(string toForm, uint fieldId, string fromForm, string expression)
		{
			if (expression == null || expression.get_Length() == 0)
			{
				return null;
			}
			ProcessResult processResult = this.ExecuteSpecialCommand("Application-Parse-Val-SField", new object[]
			{
				toForm,
				fieldId,
				fromForm,
				expression
			});
			string returnString = processResult.ReturnString;
			object obj = this.DecodeAssignment(returnString);
			string text = this.FormatAssignment(toForm, fieldId, fromForm, obj);
			return obj;
		}
		public object ParseQualification(string form, string qualification)
		{
			return this.ParseQualification(form, null, qualification);
		}
		public object ParseQualification(string form, string vui, string qualification)
		{
			if (this.VersionMajor <= 4)
			{
				return this.LoadQualifier(form, vui, qualification);
			}
			string returnString;
			if (this.IsAdministrator)
			{
				ProcessResult processResult;
				if (vui != null)
				{
					processResult = this.ExecuteSpecialCommand("Application-Parse-Qual-L", new object[]
					{
						form,
						vui,
						qualification
					});
				}
				else
				{
					processResult = this.ExecuteSpecialCommand("Application-Parse-Qual", new object[]
					{
						form,
						qualification
					});
				}
				returnString = processResult.ReturnString;
			}
			else
			{
				FieldValueList fieldValueList = new FieldValueList();
				fieldValueList.Add(3u, (vui != null) ? 20 : 2);
				fieldValueList.Add(2u, Util.SpecialCommandParamEncoding(form));
				if (vui != null)
				{
					fieldValueList.Add(1u, Util.SpecialCommandParamEncoding(vui));
				}
				fieldValueList.Add(0u, qualification);
				ActiveLinkProcessResult activeLinkProcessResult = this.ExecuteProcessForActiveLink("*RemedyApplicationCommand", 9999u, Server.ExecuteProcessActionType.Unknown, 0, new DateTime(1970, 1, 1), null, fieldValueList);
				returnString = activeLinkProcessResult.ReturnString;
			}
			return this.DecodeQualifier(returnString);
		}
		public object ParseFilterQualification(string form, string qualification)
		{
			string returnString;
			if (this.IsAdministrator)
			{
				ProcessResult processResult = this.ExecuteSpecialCommand("Application-Parse-Qual-Filter", new object[]
				{
					form,
					qualification
				});
				returnString = processResult.ReturnString;
			}
			else
			{
				FieldValueList fieldValueList = new FieldValueList();
				fieldValueList.Add(3u, Server.SpecialCommandIds.ARAPP_APPLIC_2_QUAL_FILTER);
				fieldValueList.Add(2u, Util.SpecialCommandParamEncoding(form));
				fieldValueList.Add(0u, qualification);
				ActiveLinkProcessResult activeLinkProcessResult = this.ExecuteProcessForActiveLink("*RemedyApplicationCommand", 9999u, Server.ExecuteProcessActionType.Unknown, 0, new DateTime(1970, 1, 1), null, fieldValueList);
				returnString = activeLinkProcessResult.ReturnString;
			}
			return this.DecodeQualifier(returnString);
		}
		public string FormatQualification(string form, object qualification)
		{
			string text;
			if (qualification is string)
			{
				text = (string)qualification;
			}
			else
			{
				text = this.EncodeQualifier(qualification);
			}
			if (text.get_Length() == 0)
			{
				return text;
			}
			try
			{
				string returnString;
				if (this.IsAdministrator)
				{
					ProcessResult processResult = this.ExecuteSpecialCommand("Application-Format-Qual-Filter", new object[]
					{
						form,
						text
					});
					returnString = processResult.ReturnString;
				}
				else
				{
					FieldValueList fieldValueList = new FieldValueList();
					fieldValueList.Add(3u, 10);
					fieldValueList.Add(2u, Util.SpecialCommandParamEncoding(form));
					fieldValueList.Add(0u, text);
					ActiveLinkProcessResult activeLinkProcessResult = this.ExecuteProcessForActiveLink("*RemedyApplicationCommand", 9999u, Server.ExecuteProcessActionType.Unknown, 0, new DateTime(1970, 1, 1), null, fieldValueList);
					returnString = activeLinkProcessResult.ReturnString;
				}
				return returnString;
			}
			catch (ARException var_5_AC)
			{
			}
			return string.Format("encoded({0})", text);
		}
		public object ParseSetIfQualification(string form1, string form2, string qualification)
		{
			string encodedQualText;
			if (qualification.StartsWith("encoded:"))
			{
				encodedQualText = qualification.Substring("encoded:".get_Length());
			}
			if (this.IsAdministrator)
			{
				ProcessResult processResult = this.ExecuteSpecialCommand("Application-Parse-Qual-SField", new object[]
				{
					form1,
					form2,
					qualification
				});
				encodedQualText = processResult.ReturnString;
			}
			else
			{
				FieldValueList fieldValueList = new FieldValueList();
				fieldValueList.Add(3u, 4);
				fieldValueList.Add(2u, Util.SpecialCommandParamEncoding(form1));
				fieldValueList.Add(1u, Util.SpecialCommandParamEncoding(form2));
				fieldValueList.Add(0u, qualification);
				ActiveLinkProcessResult activeLinkProcessResult = this.ExecuteProcessForActiveLink("*RemedyApplicationCommand", 9999u, Server.ExecuteProcessActionType.Unknown, 0, new DateTime(1970, 1, 1), null, fieldValueList);
				encodedQualText = activeLinkProcessResult.ReturnString;
			}
			return this.DecodeQualifier(encodedQualText);
		}
		public string FormatSetIfQualification(string form1, string form2, object qualification)
		{
			string text;
			if (qualification is string)
			{
				text = (string)qualification;
				if (text.StartsWith("encoded:"))
				{
					text = text.Substring("encoded:".get_Length());
				}
			}
			else
			{
				text = this.EncodeQualifier(qualification);
			}
			string result;
			try
			{
				if (this.IsAdministrator)
				{
					ProcessResult processResult = this.ExecuteSpecialCommand("Application-Format-Qual-SField", new object[]
					{
						form1,
						form2,
						text
					});
					result = processResult.ReturnString;
				}
				else
				{
					FieldValueList fieldValueList = new FieldValueList();
					fieldValueList.Add(4u, 11);
					fieldValueList.Add(3u, Util.SpecialCommandParamEncoding(form1));
					fieldValueList.Add(2u, Util.SpecialCommandParamEncoding(form2));
					fieldValueList.Add(0u, text);
					ActiveLinkProcessResult activeLinkProcessResult = this.ExecuteProcessForActiveLink("*RemedyApplicationCommand", 9999u, Server.ExecuteProcessActionType.Unknown, 0, new DateTime(1970, 1, 1), null, fieldValueList);
					result = activeLinkProcessResult.ReturnString;
				}
			}
			catch (Exception var_5_CF)
			{
				result = "encoded:" + text;
			}
			return result;
		}
		public string FormatAssignment(string form, uint fieldId, string form2, object assignment)
		{
			string text;
			if (assignment is string)
			{
				text = (string)assignment;
			}
			else
			{
				text = this.EncodeAssignment(assignment);
			}
			string result;
			try
			{
				if (this.IsAdministrator)
				{
					ProcessResult processResult = this.ExecuteSpecialCommand("Application-Format-Val-SField", new object[]
					{
						form,
						fieldId,
						form2,
						text
					});
					result = processResult.ReturnString;
				}
				else
				{
					FieldValueList fieldValueList = new FieldValueList();
					fieldValueList.Add(4u, 12);
					fieldValueList.Add(3u, Util.SpecialCommandParamEncoding(form));
					fieldValueList.Add(2u, Util.SpecialCommandParamEncoding(fieldId.ToString()));
					fieldValueList.Add(1u, Util.SpecialCommandParamEncoding(form2));
					fieldValueList.Add(0u, text);
					ActiveLinkProcessResult activeLinkProcessResult = this.ExecuteProcessForActiveLink("*RemedyApplicationCommand", 9999u, Server.ExecuteProcessActionType.Unknown, 0, new DateTime(1970, 1, 1), null, fieldValueList);
					result = activeLinkProcessResult.ReturnString;
				}
			}
			catch (Exception)
			{
				result = string.Format("encoded:({0})", text);
			}
			return result;
		}
		public ProcessResult ExecuteSpecialCommand(string cmd, params object[] parameters)
		{
			ArrayList arrayList = (ArrayList)ARTypeMgr.Instance.ApplicationCommands.get_Item(cmd);
			string text = "";
			if (arrayList != null && arrayList.get_Item(1) != null && arrayList.get_Item(1) is string)
			{
				text = (string)arrayList.get_Item(1);
			}
			int i = 0;
			int num = (parameters != null) ? (parameters.Length - 1) : 0;
			while (i < num)
			{
				if (parameters[i] != null && parameters[i] is string)
				{
					parameters[i] = Util.SpecialCommandParamEncoding((string)parameters[i]);
				}
				i++;
			}
			string text2 = string.Format("{0} {1}", cmd, text);
			string command = string.Format(text2, parameters);
			return this.ExecuteProcess(command);
		}
		public string ExecuteProcessForActiveLinkAsync(string activeLinkName, uint actionIndex, Server.ExecuteProcessActionType actionType, int fieldIndex, DateTime timeStamp, FieldValueList keywordValues, FieldValueList parameterValues)
		{
			object obj = Util.GetARTimestamp(timeStamp);
			object obj2 = ARTypeMgr.Instance.toVariant(keywordValues);
			object obj3 = ARTypeMgr.Instance.toVariant(parameterValues);
			object[] array = new object[11];
			array[0] = "ARExecuteProcessForActiveLink";
			array[1] = this._control;
			array[2] = activeLinkName;
			array[3] = actionIndex;
			array[4] = (int)actionType;
			array[5] = fieldIndex;
			array[6] = obj;
			array[7] = obj2;
			array[8] = obj3;
			object[] v = array;
			object[] array2 = (object[])this._Eval(v);
			return (string)array2[10];
		}
		[ComVisible(false)]
		public DataTable GetListSQL(string sqlCommand, int maxRetrieve)
		{
			int num;
			return this.GetListSQL(sqlCommand, maxRetrieve, out num);
		}
		public DataTable GetListSQL(string sqlCommand, int maxRetrieve, out int numMatches)
		{
			return this.GetListSQL(sqlCommand, maxRetrieve, out numMatches, null);
		}
		public DataTable GetListSQL(string sqlCommand, int maxRetrieve, out int numMatches, Type[] colTypes)
		{
			object[] v = new object[]
			{
				"ARGetListSQL",
				this._control,
				sqlCommand,
				maxRetrieve
			};
			object[] array = (object[])this._Eval(v);
			numMatches = Convert.ToInt32(array[6]);
			return Util.BuildGLSQLResponseDataTable((object[])array[5], colTypes);
		}
		public DataTable GetListSQLForActiveLink(string activeLinkName, uint actionIndex, uint actionType, DateTime timeStamp, FieldValueList keywordValues, FieldValueList parameterValues, int maxRetrieve, out int numMatches, Type[] colTypes, out string returnCommand)
		{
			object obj = Util.GetARTimestamp(timeStamp);
			object obj2 = ARTypeMgr.Instance.toVariant(keywordValues);
			object obj3 = ARTypeMgr.Instance.toVariant(parameterValues);
			object[] v = new object[]
			{
				"ARExecuteProcessForActiveLink",
				this._control,
				activeLinkName,
				actionIndex,
				actionType,
				obj,
				obj2,
				obj3,
				maxRetrieve
			};
			object[] array = (object[])this._Eval(v);
			numMatches = Convert.ToInt32(array[11]);
			returnCommand = (string)array[12];
			return Util.BuildGLSQLResponseDataTable((object[])array[10], colTypes);
		}
		public void ImportDefinitions(Stream stream, bool importInPlace)
		{
			this.ImportDefinitions(stream, (importInPlace ? 1 : 0) | 48);
		}
		public void ImportDefinitions(Stream stream, int optionsMask)
		{
			ArrayList importItems = new ArrayList();
			this.ImportDefinitions(stream, optionsMask, importItems);
		}
		public void ImportDefinitions(Stream stream, int optionsMask, ArrayList importItems)
		{
			this.ImportDefinitions(stream, optionsMask, importItems, null);
		}
		public void ImportDefinitions(Stream stream, int optionsMask, ArrayList importItems, string modificationLogLabel)
		{
			byte[] array = new byte[stream.get_Length() + 1L];
			stream.Read(array, 0, (int)stream.get_Length());
			object obj = ARTypeMgr.Instance.toVariant(importItems);
			object[] v = new object[]
			{
				"ARImport",
				this._control,
				obj,
				array,
				optionsMask
			};
			object[] arg_63_0 = (object[])this._Eval(v);
		}
		public void Export(string filePath, object[,] exportItems, bool appendToFile, bool useXml)
		{
			object aRStructItemList = Util.GetARStructItemList(exportItems, useXml);
			object[] v = new object[]
			{
				"ARExport",
				this._control,
				aRStructItemList,
				new object[]
				{
					filePath,
					appendToFile ? "ab" : "wb",
					0
				}
			};
			object[] arg_5D_0 = (object[])this._Eval(v);
		}
		public void ExportDefinitions(string filePath, ArrayList exportItems, bool appendToFile, bool useXml)
		{
			object aRStructItemList = Util.GetARStructItemList(exportItems, useXml);
			object[] v = new object[]
			{
				"ARExport",
				this._control,
				aRStructItemList,
				new object[]
				{
					filePath,
					appendToFile ? "ab" : "wb",
					0
				}
			};
			object[] arg_5D_0 = (object[])this._Eval(v);
		}
		public GroupInfo[] GetListGroup(string userName, string password)
		{
			object[] v = new object[]
			{
				"ARGetListGroup",
				this._control,
				userName,
				password
			};
			object[] array = (object[])this._Eval(v);
			return (GroupInfo[])ARTypeMgr.Instance.ObjectArrayFromVariant(typeof(GroupInfo), (object[])array[5], this);
		}
		public UserInfo[] GetListUser(Server.UserListType userListType, DateTime changedSince)
		{
			object obj = Util.GetARTimestamp(changedSince);
			object[] v = new object[]
			{
				"ARGetListUser",
				this._control,
				(int)userListType,
				obj
			};
			object[] array = (object[])this._Eval(v);
			return (UserInfo[])ARTypeMgr.Instance.ObjectArrayFromVariant(typeof(UserInfo), (object[])array[5], this);
		}
		public string[] GetListApplicationState()
		{
			object[] v = new object[]
			{
				"ARGetListApplicationState",
				this._control
			};
			object[] array = (object[])this._Eval(v);
			return (string[])ARTypeMgr.Instance.ObjectArrayFromVariant(typeof(string), (object[])array[3], this);
		}
		public string GetApplicationState(string applicationName)
		{
			object[] v = new object[]
			{
				"ARGetApplicationState",
				this._control,
				applicationName
			};
			object[] array = (object[])this._Eval(v);
			return (string)array[4];
		}
		public void SetApplicationState(string applicationName, string newState)
		{
			object[] v = new object[]
			{
				"ARSetApplicationState",
				this._control,
				applicationName,
				newState
			};
			object[] arg_2E_0 = (object[])this._Eval(v);
		}
		public string[] GetMultipleCurrencyRatioSets(DateTime[] ratioTimestamps)
		{
			object obj = ARTypeMgr.Instance.toVariant(ratioTimestamps);
			object[] v = new object[]
			{
				"ARGetMultipleCurrencyRatioSets",
				this._control,
				obj
			};
			object[] array = (object[])this._Eval(v);
			return (string[])ARTypeMgr.Instance.ObjectArrayFromVariant(typeof(string), (object[])array[4], this);
		}
		public string[] GetCurrentCurrencyRatioSets()
		{
			DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0);
			return this.GetMultipleCurrencyRatioSets(new DateTime[]
			{
				dateTime
			});
		}
		public decimal GetCurrencyRatio(string currencyRatiosString, string fromCode, string toCode)
		{
			object[] v = new object[]
			{
				"ARGetCurrencyRatio",
				this._control,
				currencyRatiosString,
				fromCode,
				toCode
			};
			object[] rawData = (object[])this._Eval(v);
			return Util.ToDecimal(Util.GetAt(rawData, new int[]
			{
				6,
				1
			}));
		}
		public RoleInfo[] GetListRole(string applicationName, string userName, string password)
		{
			object[] v = new object[]
			{
				"ARGetListRole",
				this._control,
				applicationName,
				userName,
				password
			};
			object[] array = (object[])this._Eval(v);
			return (RoleInfo[])ARTypeMgr.Instance.ObjectArrayFromVariant(typeof(RoleInfo), (object[])array[6], this);
		}
		public RoleInfo[] GetListRole(string applicationName)
		{
			return this.GetListRole(applicationName, "", "");
		}
		[ComVisible(false)]
		public IDictionary GetServerStatistics(uint[] tags)
		{
			object obj = ARTypeMgr.Instance.toVariant(tags);
			object[] v = new object[]
			{
				"ARGetServerStatistics",
				this._control,
				obj
			};
			object[] array = (object[])this._Eval(v);
			ARTypeMgr arg_77_0 = ARTypeMgr.Instance;
			Type arg_77_1 = typeof(Hashtable);
			string arg_77_2 = "System.Int32";
			int[] keyIndex = new int[1];
			return arg_77_0.BuildCustomDictionaryFromVariant(arg_77_1, arg_77_2, keyIndex, "ARValue", new int[]
			{
				1
			}, (object[])array[4], this);
		}
		[ComVisible(false)]
		public IDictionary GetServerInfo(int[] tags)
		{
			object obj = ARTypeMgr.Instance.toVariant(tags);
			object[] v = new object[]
			{
				"ARGetServerInfo",
				this._control,
				obj
			};
			object[] array = (object[])this._Eval(v);
			ARTypeMgr arg_77_0 = ARTypeMgr.Instance;
			Type arg_77_1 = typeof(Hashtable);
			string arg_77_2 = "System.Int32";
			int[] keyIndex = new int[1];
			return arg_77_0.BuildCustomDictionaryFromVariant(arg_77_1, arg_77_2, keyIndex, "ARValue", new int[]
			{
				1
			}, (object[])array[4], this);
		}
		[ComVisible(false)]
		public void SetServerInfo(IDictionary serverInfo)
		{
			ARTypeMgr arg_29_0 = ARTypeMgr.Instance;
			string arg_29_1 = "BMC.ARSystem.FieldValueList";
			string arg_29_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj = arg_29_0.BuildVariantFromCustomDictionary(arg_29_1, arg_29_2, keyIndex, "ARValue", new int[]
			{
				1
			}, serverInfo);
			object[] v = new object[]
			{
				"ARSetServerInfo",
				this._control,
				obj
			};
			object[] arg_59_0 = (object[])this._Eval(v);
		}
		public object GetSessionConfiguration(int tag)
		{
			object obj = ARTypeMgr.Instance.toVariant(tag);
			object[] v = new object[]
			{
				"ARGetSessionConfiguration",
				this._control,
				obj
			};
			object[] array = (object[])this._Eval(v);
			return Util.ConvertFromARValue((object[])array[4], false, false);
		}
		public void SetSessionConfiguration(int tag, object val)
		{
			object obj = ARTypeMgr.Instance.toVariant(tag);
			object obj2 = Util.ConvertToARValue(val);
			object[] v = new object[]
			{
				"ARSetSessionConfiguration",
				this._control,
				obj,
				obj2
			};
			object[] arg_46_0 = (object[])this._Eval(v);
		}
		public object GetSessionVariable(int tag)
		{
			object obj = ARTypeMgr.Instance.toVariant(tag);
			object[] v = new object[]
			{
				"ARGetSessionVariable",
				this._control,
				obj
			};
			object[] array = (object[])this._Eval(v);
			return Util.ConvertFromARValue((object[])array[4], false, false);
		}
		public void SetSessionVariable(int tag, object val)
		{
			object obj = ARTypeMgr.Instance.toVariant(tag);
			object obj2 = Util.ConvertToARValue(val);
			object[] v = new object[]
			{
				"ARSetSessionVariable",
				this._control,
				obj,
				obj2
			};
			object[] arg_46_0 = (object[])this._Eval(v);
		}
		public void Signal(IDictionary signalInfo)
		{
			ARTypeMgr arg_29_0 = ARTypeMgr.Instance;
			string arg_29_1 = "ARSignalList";
			string arg_29_2 = "System.Int32";
			int[] keyIndex = new int[1];
			object obj = arg_29_0.BuildVariantFromCustomDictionary(arg_29_1, arg_29_2, keyIndex, "System.String", new int[]
			{
				1
			}, signalInfo);
			object[] v = new object[]
			{
				"ARSignal",
				this._control,
				obj
			};
			object[] arg_59_0 = (object[])this._Eval(v);
		}
		public void SignalConfigurationChanged()
		{
			IDictionary dictionary = new Hashtable();
			dictionary.set_Item(1, "");
			this.Signal(dictionary);
		}
		public void SignalGroupCacheChanged()
		{
			IDictionary dictionary = new Hashtable();
			dictionary.set_Item(2, "");
			this.Signal(dictionary);
		}
		public void SignalLicenseChanged()
		{
			IDictionary dictionary = new Hashtable();
			dictionary.set_Item(3, "");
			this.Signal(dictionary);
		}
		public void SignalAlertUserChanged()
		{
			IDictionary dictionary = new Hashtable();
			dictionary.set_Item(4, "");
			this.Signal(dictionary);
		}
		public void SignalDSO(int signalCode)
		{
			IDictionary dictionary = new Hashtable();
			dictionary.set_Item(5, Convert.ToByte(signalCode));
			this.Signal(dictionary);
		}
		public void SignalUserCacheChanged()
		{
			IDictionary dictionary = new Hashtable();
			dictionary.set_Item(6, "");
			this.Signal(dictionary);
		}
		public void SignalApplication(int signalCode)
		{
			IDictionary dictionary = new Hashtable();
			dictionary.set_Item(7, Convert.ToByte(signalCode));
			this.Signal(dictionary);
		}
		public void SignalArchiveChanged()
		{
			IDictionary dictionary = new Hashtable();
			dictionary.set_Item(8, "");
			this.Signal(dictionary);
		}
		public void SignalEscalationChanged()
		{
			IDictionary dictionary = new Hashtable();
			dictionary.set_Item(9, "");
			this.Signal(dictionary);
		}
		public void SignalRecache()
		{
			IDictionary dictionary = new Hashtable();
			dictionary.set_Item(10, "");
			this.Signal(dictionary);
		}
		public void SignalComputedGroupChanged()
		{
			IDictionary dictionary = new Hashtable();
			dictionary.set_Item(11, "");
			this.Signal(dictionary);
		}
		public void ImpersonateUser(string userName)
		{
			if (this.VersionMajor < 7)
			{
				throw new Exception(string.Format("Impersonation is not supported on server({0}) of version '{1}'", this.ServerName, this.Version));
			}
			object[] v = new object[]
			{
				"ARSetImpersonatedUser",
				this._control,
				userName
			};
			object[] arg_4F_0 = (object[])this._Eval(v);
		}
		public void ImpersonateEnd()
		{
			this.ImpersonateUser(null);
		}
		public void CreateLicense(LicenseInfo licenseInfo)
		{
			object obj = ARTypeMgr.Instance.toVariant(licenseInfo);
			object[] v = new object[]
			{
				"ARCreateLicense",
				this._control,
				obj
			};
			object[] arg_36_0 = (object[])this._Eval(v);
		}
		public void DeleteLicense(string type, string key)
		{
			object[] v = new object[]
			{
				"ARDeleteLicense",
				this._control,
				type,
				key
			};
			object[] arg_2E_0 = (object[])this._Eval(v);
		}
		public void ValidateLicense(LicenseInfo licenseInfo)
		{
			object obj = ARTypeMgr.Instance.toVariant(licenseInfo);
			object[] v = new object[]
			{
				"ARValidateLicense",
				this._control,
				obj
			};
			object[] rawData = (object[])this._Eval(v);
			licenseInfo.SetIsDemo((bool)Util.GetAt(rawData, new int[]
			{
				4,
				1
			}));
		}
		public ArrayList GetListLicense(string type)
		{
			object[] v = new object[]
			{
				"ARGetListLicense",
				this._control,
				type
			};
			object[] array = (object[])this._Eval(v);
			return ARTypeMgr.Instance.ArrayListFromVariant(typeof(LicenseInfo), (object[])array[4], this);
		}
		public void ExportLicense(string filePath)
		{
			object[] v = new object[]
			{
				"ARExportLicense",
				this._control
			};
			object[] array = (object[])this._Eval(v);
			BinaryWriter binaryWriter = new BinaryWriter(new FileStream(filePath, 2));
			binaryWriter.Write(array[3].ToString());
			binaryWriter.Close();
		}
		public void ImportLicense(string filePath, uint option)
		{
			StreamReader streamReader = new StreamReader(filePath);
			string text = streamReader.ReadToEnd();
			streamReader.Close();
			object[] v = new object[]
			{
				"ARImportLicense",
				this._control,
				text,
				option
			};
			object[] arg_47_0 = (object[])this._Eval(v);
		}
		public void BeginBulkEntryTransaction()
		{
			object[] v = new object[]
			{
				"ARBeginBulkEntryTransaction",
				this._control
			};
			object[] arg_26_0 = (object[])this._Eval(v);
			this._lastBulkEntryTransactionReturnList = new ArrayList();
		}
		private ArrayList EndBulkEntryTransaction(bool sendFlag)
		{
			object[] v = new object[]
			{
				"AREndBulkEntryTransaction",
				this._control,
				sendFlag ? 1 : 2
			};
			object[] array = (object[])this._Eval(v);
			this._lastBulkEntryTransactionReturnList = Util.BuildArrayListFromBulkEntryTxnReturnList((object[])array[4]);
			return this._lastBulkEntryTransactionReturnList;
		}
		public ArrayList SendBulkEntryTransaction()
		{
			return this.EndBulkEntryTransaction(true);
		}
		public ArrayList CancelBulkEntryTransaction()
		{
			return this.EndBulkEntryTransaction(false);
		}
		public ArrayList GetLastBulkEntryTransactionReturnList()
		{
			return this._lastBulkEntryTransactionReturnList;
		}
		public int DateToJulianDate(int year, int month, int day)
		{
			object[] v = new object[]
			{
				"ARDateToJulianDate",
				this._control,
				new object[]
				{
					year,
					month,
					day
				}
			};
			object[] array = (object[])this._Eval(v);
			return Convert.ToInt32(array[4]);
		}
		public void JulianDateToDate(int julianDate, out int year, out int month, out int day)
		{
			object[] v = new object[]
			{
				"ARJulianDateToDate",
				this._control,
				julianDate
			};
			object[] array = (object[])this._Eval(v);
			object arg_3E_0 = array;
			int[] array2 = new int[2];
			array2[0] = 4;
			year = Convert.ToInt32(Util.GetAt(arg_3E_0, array2));
			month = Convert.ToInt32(Util.GetAt(array, new int[]
			{
				4,
				1
			}));
			day = Convert.ToInt32(Util.GetAt(array, new int[]
			{
				4,
				2
			}));
		}
		public void ValidateFormCache(string formName, DateTime lastKnownUpdateTimeActLink, DateTime lastKnownUpdateTimeMenu, DateTime lastKnownUpdateTimeActLinkGuide, out DateTime lastUpdateTimeForm, out DateTime lastUpdateTimeOfGroupsForThisUser, out DateTime lastUpdateTimeOfThisUser, out int numActLinksOnForm, out int numActLinksUpdatedSince, out ArrayList menusUpdatedSince, out ArrayList actLinkGuidesUpdatedSince)
		{
			object obj = Util.GetARTimestamp(lastKnownUpdateTimeActLink);
			object obj2 = Util.GetARTimestamp(lastKnownUpdateTimeMenu);
			object obj3 = Util.GetARTimestamp(lastKnownUpdateTimeActLinkGuide);
			object[] v = new object[]
			{
				"ARValidateFormCache",
				this._control,
				formName,
				obj,
				obj2,
				obj3
			};
			object[] array = (object[])this._Eval(v);
			lastUpdateTimeForm = Util.GetDateTime(Convert.ToUInt32(array[7]));
			numActLinksOnForm = Convert.ToInt32(array[8]);
			numActLinksUpdatedSince = Convert.ToInt32(array[9]);
			menusUpdatedSince = new ArrayList((object[])array[10]);
			lastUpdateTimeOfGroupsForThisUser = Util.GetDateTime(Convert.ToUInt32(array[11]));
			lastUpdateTimeOfThisUser = Util.GetDateTime(Convert.ToUInt32(array[12]));
			actLinkGuidesUpdatedSince = new ArrayList((object[])array[13]);
		}
		public void EnableServerLoggingToClient(int logTypeMask, string filePath)
		{
			this.SetLogging(logTypeMask, filePath);
		}
		public void DisableServerLoggingToClient()
		{
			this.SetLogging(0, null);
		}
		private void SetLogging(int logTypeMask, string filePath)
		{
			object[] v = new object[]
			{
				"ARSetLogging",
				this._control,
				logTypeMask,
				(logTypeMask == 0) ? 0 : ((filePath != null) ? 1 : 2),
				new object[]
				{
					filePath,
					"w",
					this._logFilePtr
				}
			};
			object[] array = (object[])this._Eval(v);
			this._logFilePath = filePath;
			this._logFilePtr = (uint)array[5];
		}
		public string GetTextForErrorMessage(int messageId)
		{
			object[] v = new object[]
			{
				"ARGetTextForErrorMessage",
				this._control,
				messageId
			};
			object[] array = (object[])this._Eval(v);
			return (string)array[3];
		}
		public void Enable(Server.ObjectType objectType, string objectName)
		{
			this.SetEnabledState(objectType, objectName, true);
		}
		public void Disable(Server.ObjectType objectType, string objectName)
		{
			this.SetEnabledState(objectType, objectName, false);
		}
		public void Rename(Server.ObjectType objectType, string objectName, string newName)
		{
			if (objectType <= Server.ObjectType.Escalation)
			{
				if (objectType != Server.ObjectType.Form)
				{
					switch (objectType)
					{
					case Server.ObjectType.Filter:
						this.SetFilter(new Filter(objectName)
						{
							NewName = newName
						});
						return;
					case Server.ObjectType.ActiveLink:
						this.SetActiveLink(new ActiveLink(objectName)
						{
							NewName = newName
						});
						return;
					case (Server.ObjectType)7:
					case Server.ObjectType.Menu:
						break;
					case Server.ObjectType.Escalation:
						this.SetEscalation(new Escalation(objectName)
						{
							NewName = newName
						});
						break;
					default:
						return;
					}
					return;
				}
				ARForm form = this.GetForm(objectName);
				form.NewName = newName;
				this.SetForm(form);
				return;
			}
			else
			{
				if (objectType != Server.ObjectType.Container && objectType != Server.ObjectType.Application)
				{
					return;
				}
				Container container = this.GetContainer(objectName);
				container.NewName = newName;
				this.SetContainer(container);
				return;
			}
		}
		public ArrayList GetMultipleEntryPoints()
		{
			return this.GetMultipleEntryPoints(new DateTime(1970, 1, 1));
		}
		public ArrayList GetMultipleEntryPoints(DateTime changedSince)
		{
			object obj = Util.GetARTimestamp(changedSince);
			object[] v = new object[]
			{
				"ARGetMultipleEntryPoints",
				this._control,
				obj
			};
			object[] array = (object[])this._Eval(v);
			return new ArrayList((object[])array[9]);
		}
		public void CreateUser(string entryId, string name, string password, string emailAddr, string groupIdList, string notifyMechanism, int writeLicenseType, int ftsLicenseType, int dashboardLicenseType, string applicenses, string authAliasName, string authAliasString)
		{
			object obj = ARTypeMgr.Instance.toVariant(Util.SplitIntoIntArray(groupIdList));
			int[] array = new int[25];
			for (int i = 0; i < 25; i++)
			{
				array[i] = 0;
			}
			array[1] = writeLicenseType;
			array[2] = ftsLicenseType;
			array[3] = dashboardLicenseType;
			array[1] = writeLicenseType;
			object obj2 = ARTypeMgr.Instance.toVariant(array);
			object[] v = new object[]
			{
				"ARCreateUser",
				this._control,
				this.ServerName,
				this.ServerPort,
				entryId,
				name,
				password,
				emailAddr,
				obj,
				notifyMechanism,
				obj2,
				applicenses,
				authAliasName,
				authAliasString
			};
			object[] arg_CD_0 = (object[])this._Eval(v);
		}
		public void DeleteUser(string entryId, string name)
		{
			object[] v = new object[]
			{
				"ARDeleteUser",
				this._control,
				this.ServerName,
				this.ServerPort,
				entryId,
				name
			};
			object[] arg_45_0 = (object[])this._Eval(v);
		}
		public void CreateGroup(string entryId, string name, int groupId, Server.GroupType groupType, Server.GroupCategory groupCategory, string groupQualification, string appLicense, int groupParentId)
		{
			object[] v = new object[]
			{
				"ARCreateGroup",
				this._control,
				this.ServerName,
				this.ServerPort,
				entryId,
				name,
				groupId,
				(int)groupType,
				(int)groupCategory,
				groupQualification,
				appLicense,
				groupParentId
			};
			object[] arg_7A_0 = (object[])this._Eval(v);
		}
		public void DeleteGroup(string entryId, string name)
		{
			object[] v = new object[]
			{
				"ARDeleteGroup",
				this._control,
				this.ServerName,
				this.ServerPort,
				entryId,
				name
			};
			object[] arg_45_0 = (object[])this._Eval(v);
		}
		private string GetCharSet(bool ofServer)
		{
			object[] v = new object[]
			{
				ofServer ? "ARGetServerCharSet" : "ARGetClientCharSet",
				this._control
			};
			object[] array = (object[])this._Eval(v);
			return (string)array[3];
		}
		public void RunEscalation(string escalationName)
		{
			object[] v = new object[]
			{
				"ARRunEscalation",
				this._control,
				escalationName
			};
			object[] arg_2A_0 = (object[])this._Eval(v);
		}
		public ArrayList GetListCacheEvent(ArrayList eventTypes, bool returnImmediately, out int cacheCount)
		{
			object obj = ARTypeMgr.Instance.toVariant(eventTypes);
			object obj2 = returnImmediately ? 0 : 1;
			object[] v = new object[]
			{
				"ARGetCacheEvent",
				this._control,
				obj,
				obj2
			};
			object[] array = (object[])this._Eval(v);
			cacheCount = Convert.ToInt32(array[6]);
			return new ArrayList((object[])array[5]);
		}
		public string CreateAlertEvent(AlertMessage alertMessage)
		{
			object user = alertMessage.User;
			object alertText = alertMessage.AlertText;
			object obj = alertMessage.Priority;
			object obj2 = alertMessage.SourceType;
			object serverName = alertMessage.ServerName;
			object formName = alertMessage.FormName;
			object objectId = alertMessage.ObjectId;
			object[] v = new object[]
			{
				"ARCreateAlertEvent",
				this._control,
				user,
				alertText,
				obj,
				obj2,
				serverName,
				formName,
				objectId,
				alertText,
				user,
				alertText
			};
			object[] array = (object[])this._Eval(v);
			alertMessage.SetEntryId((string)array[10]);
			return alertMessage.EntryId;
		}
		public void RegisterForAlerts(int clientPort)
		{
			object obj = clientPort;
			int num = 0;
			object obj2 = num;
			object[] v = new object[]
			{
				"ARRegisterForAlerts",
				this._control,
				obj,
				obj2
			};
			object[] arg_44_0 = (object[])this._Eval(v);
		}
		public void DeregisterForAlerts(int clientPort)
		{
			object obj = clientPort;
			object[] v = new object[]
			{
				"ARDeregisterForAlerts",
				this._control,
				obj
			};
			object[] arg_31_0 = (object[])this._Eval(v);
		}
		public ArrayList GetListAlertUser()
		{
			object[] v = new object[]
			{
				"ARGetListAlertUser",
				this._control
			};
			object[] array = (object[])this._Eval(v);
			return new ArrayList((object[])array[3]);
		}
		public int GetAlertCount(string qualification)
		{
			object obj = this.ParseQualification("Alert List", null, qualification);
			object[] v = new object[]
			{
				"ARGetAlertCount",
				this._control,
				obj
			};
			object[] array = (object[])this._Eval(v);
			return Convert.ToInt32(array[4]);
		}
		public AlertMessage DecodeAlertMessage(byte[] buffer, int bufferLen)
		{
			object obj = bufferLen;
			object[] v = new object[]
			{
				"ARDecodeAlertMessage",
				this._control,
				buffer,
				obj
			};
			object[] rawData = (object[])this._Eval(v);
			return AlertMessage.createInstance(rawData, this);
		}
		public void DeleteAlert(string entryId)
		{
			FieldValueList fieldValueList = new FieldValueList();
			fieldValueList.Add(0u, entryId);
			this.ExecuteProcessForActiveLink("*RemedyDeleteAlert", 9999u, Server.ExecuteProcessActionType.Unknown, 0, new DateTime(1970, 1, 1), null, fieldValueList);
		}
		public ArrayList GetLastStatus()
		{
			return this.LastStatus;
		}
		private object[] GetCharMenuInternal(string name)
		{
			object[] v = new object[]
			{
				"ARGetCharMenu",
				this._control,
				name
			};
			return (object[])this._Eval(v);
		}
		private object DeleteObject(string apiCmd, string name, int deleteOption, string modificationLogLabel)
		{
			object[] v = new object[]
			{
				apiCmd,
				this._control,
				name,
				deleteOption,
				modificationLogLabel
			};
			return (object[])this._Eval(v);
		}
		private void SetEnabledState(Server.ObjectType objectType, string objectName, bool val)
		{
			switch (objectType)
			{
			case Server.ObjectType.Filter:
				this.SetFilter(new Filter(objectName)
				{
					Enabled = val
				});
				return;
			case Server.ObjectType.ActiveLink:
				this.SetActiveLink(new ActiveLink(objectName)
				{
					Enabled = val
				});
				return;
			case (Server.ObjectType)7:
			case Server.ObjectType.Menu:
				break;
			case Server.ObjectType.Escalation:
				this.SetEscalation(new Escalation(objectName)
				{
					Enabled = val
				});
				break;
			default:
				return;
			}
		}
		private ArrayList GetListObjectByForm(string apiCmd, string formName, DateTime changedSince)
		{
			object obj = Util.GetARTimestamp(changedSince);
			object[] v = new object[]
			{
				apiCmd,
				this._control,
				formName,
				obj
			};
			object[] array = (object[])this._Eval(v);
			return new ArrayList((object[])array[6]);
		}
		internal string FirstOperationTime(string str)
		{
			object[] v = new object[]
			{
				"_FirstOperationTime",
				this._control,
				str
			};
			object[] array = (object[])this._Eval(v);
			return (string)array[3];
		}
		internal string SecondOperationTime(object str, uint id)
		{
			object[] v = new object[]
			{
				"_SecondOperationTime",
				this._control,
				str,
				id
			};
			object[] array = (object[])this._Eval(v);
			return (string)array[3];
		}
		public object _Eval(object v)
		{
			object[] array = (object[])API.eval(v);
			if (array.Length > 1)
			{
				ArrayList arrayList = ARTypeMgr.Instance.ArrayListFromVariant(typeof(Status), (object[])array[1], null);
				array[1] = arrayList;
			}
			this._UpdateContext(array);
			return array;
		}
		public Exception _HandleException(Exception err)
		{
			if (this._control == null || Convert.ToInt32(this._control) == 0)
			{
				return new ARException("Login must be called prior to this call.");
			}
			if (this._returnCode >= 2)
			{
				throw new ARException(this.LastStatus.ToString());
			}
			return err;
		}
		public void _UpdateContext(object[] retVals)
		{
			if (retVals.Length >= 2)
			{
				this._returnCode = (int)retVals[0];
				this._statusList = (ArrayList)retVals[1];
				this._control = retVals[2];
				if (this._returnCode >= 2)
				{
					throw new ARException(ARTypeMgr.Instance.ObjectToString(this._statusList, 0, true));
				}
			}
		}
	}
}
